No video

Fixed Point Maths Explained - Retro Programming

  Рет қаралды 2,877

NCOT Technology

NCOT Technology

Күн бұрын

Пікірлер: 13
@agnichatian
@agnichatian 2 жыл бұрын
Fun stuff - subbed. I stumbled upon this as I'm writing some fixed-point for an ATMega328 microcontroller. I'm using "Q15.16" format in this case, in my motor control code. It is way faster than floats, especially when I also approximate the sine function using parabolas. Keep up the good work; will check out what else is on your channel.
@arronshutt
@arronshutt 2 жыл бұрын
Really impressed with the presentation and professional set up, the clear work on squared paper and it's well explained. Definitely heading into a level of explanatory quality that a certain UK university that specialises in computer files might put out :D Looking forward to the next coding video :D
@ncot_tech
@ncot_tech 2 жыл бұрын
I may be slightly influenced by a certain computing KZfaq channel, yes. Also I'm impressed that KZfaq hasn't eaten your comment this time!
@arronshutt
@arronshutt 2 жыл бұрын
@@ncot_tech I guess that I didn't mention anything contentious to KZfaq like the dislike bu[COMMENT DELETED]
@Xalior
@Xalior 2 жыл бұрын
One minor correction, the screen is 320 pixels across... You're using a mode that only uses 256 pixels across... :-P And that's before we discuss the half-width pixel mode... :-D -Dx
@ncot_tech
@ncot_tech 2 жыл бұрын
Agh you crazy hardware designers and “well who says we have to use 8 bits for everything, nine is fine” attitude. It’s thinking like that which gave us the original interleaved speccy ULA modes 😜 Guess we should be thankful you went for regular bitmaps and not bitplanes.
@Xalior
@Xalior 2 жыл бұрын
@@ncot_tech 9bit is a whole one bit better than 8bit, innit. -Dx
@bpark10001
@bpark10001 29 күн бұрын
There is a much simpler scheme (at least in concept). JUST DON'T DO FRACTIONS AT ALL! How to do this & get reasonable accuracy? Up front, declare a small unit that is "smaller than max permitted calculation error" & do all calculations in integer quantities of that unit. In game, you may choose say 1/10000th (or maybe better 1/2^n) of the playing field's dimensions. There is no "fixed point" (unless you consider the one right of the LSB the point). For the money example, let the quantities be in pence. When units are dimensionless (such as angle), choose unit that is 1/(2^n) of a full rotation. You simply ignore all carries beyond the nth bit when doing that rotation math. This "retro math" should not be retro! For example in computer aided design, integer meth should be used. Floating point math is nothing but trouble. It is very important in CAD that tests for equality work (is the cursor EXACTLY on that "handle"? Is that line & arc "connected"?) Floating point causes quantities that can never be "equal" so the thing you just placed, you can never "grab" again because you can't get the cursor EXACTLY on it. There is also the famous problem of "leakage" in PC Paint app with the paint roller, because line endpoints don't exactly match up. Endpoints of arcs other than 0°/90°/180°270° can't be exactly on line endpoints, if they are specified by center location, radius, & start/end angles. The floating point "solution" is to add "slop" in the calculation (if abs(A - B) < some small number then...). The slop "is small enough unless it is too small". If I move something around in CAD workspace, its (X,Y,Z) parameters change in precision! And no, fixed point or integer math CAN & SHOULD be used for trajectory calculations! The problem with floating point is that it has resolution that differs with the distance from zero. If I put (0,0,0) at the center of the sun, what about when I am near Jupiter? Resolution & precision will degrade! Now I have a system with precision that depends upon where I choose (0,0,0). Floating point is for quick scientific calculations for those too lazy to properly scale their units.
@jonwest776
@jonwest776 2 жыл бұрын
Enjoyed this. Look for the cheats! Look up tables.
@valentine_puppy
@valentine_puppy 2 жыл бұрын
How would this apply in creating a world like Nintendo 64 if there was no FPU? What if you had a very fast powerful fixed point DSP instead? Could you make a Mario 64 or better yet the faster Mario kart 64? Thank you for the great video 😀
@benholroyd5221
@benholroyd5221 Жыл бұрын
To be pedantic representing negative in binary isn't inherently different to decimal. I could write -01011010. The computer representation of a negative is different to how we write it. Well it can be, and generally is in practice.
@murators4732
@murators4732 2 жыл бұрын
good one!
@Tabu11211
@Tabu11211 10 ай бұрын
I want to make a 3D engine that has a ps1 aesthetic so this is essential for me.
FORTH - Better than BASIC?
14:30
NCOT Technology
Рет қаралды 38 М.
Fixed Point Decimal Numbers - Including Fixed Point Arithmetic
11:24
Gary Explains
Рет қаралды 4,5 М.
Schoolboy Runaway в реальной жизни🤣@onLI_gAmeS
00:31
МишАня
Рет қаралды 4 МЛН
Чёрная ДЫРА 🕳️ | WICSUR #shorts
00:49
Бискас
Рет қаралды 6 МЛН
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 11 МЛН
Magic trick 🪄😁
00:13
Andrey Grechka
Рет қаралды 56 МЛН
The Computer Timeline: Calculators, Maths and Reverse Polish Notation
13:53
Fixed-point math is better than floating point (sometimes)
1:32:06
Low Byte Productions
Рет қаралды 16 М.
The Internet - Mid 90's Web Culture
23:22
NCOT Technology
Рет қаралды 3,9 М.
Fixed Points
16:26
Vsauce
Рет қаралды 10 МЛН
Floating Point Numbers (Part1: Fp vs Fixed) - Computerphile
15:41
Computerphile
Рет қаралды 158 М.
Stealing the secrets of the NES - Agon Light Tilemaps in C
18:56
NCOT Technology
Рет қаралды 1,9 М.
Zilog Z80 Deep Dive - How does it work?
15:05
NCOT Technology
Рет қаралды 24 М.
how floating point works
17:48
jan Misali
Рет қаралды 371 М.
Back To Basics! Fixed Point Numbers in C++
31:24
javidx9
Рет қаралды 60 М.
The Dark Art of Programming - Writing Cursed Code
13:12
NCOT Technology
Рет қаралды 2,3 М.
Schoolboy Runaway в реальной жизни🤣@onLI_gAmeS
00:31
МишАня
Рет қаралды 4 МЛН