Digital Logic Design: How One Gate Builds Every Computer
From two's complement to metastable flip-flops and FPGAs, the surprising ideas that let simple switches compute.
Digital Logic Design · 50 questions
Try 3 questions
1. Why do rotary position encoders often output Gray code instead of plain binary?
- It can encode negative angles directly
- It uses fewer bits than plain binary
- Only one bit changes between neighboring positions
Show the answer
Answer: Only one bit changes between neighboring positions
In Gray code adjacent values differ in a single bit, so a reading taken mid-transition is never wildly wrong.
2. What range of integers can an 8-bit two's complement number represent?
- −128 to +127
- −127 to +127
- −255 to +255
Show the answer
Answer: −128 to +127
Two's complement has a single zero, so the extra pattern goes to the negative side: 256 values from −128 up to +127.
3. Why does 0.1 + 0.2 not come out exactly equal to 0.3 in standard binary floating point?
- Processors round each sum to whole numbers
- 0.1 has no exact finite binary form
- Floats keep only seven decimal digits
Show the answer
Answer: 0.1 has no exact finite binary form
Like 1/3 in decimal, 0.1 repeats forever in binary, so it is stored rounded and the small errors show up in the sum.
The whole quiz comes before your apps
BrainTok asks a few questions like these before the apps you choose open, so your screen time turns into learning. For iPhone.
Join the beta