Practice

Number system and binary code problems

How a circuit stores a number decides what its arithmetic looks like. These problems cover the representations a digital course teaches, and then build the converters between them.

73 problems5 free to solve20 easy, 33 medium, 20 hard

The circuit problems make the point concrete: a BCD counter that has to skip six states, a Gray code counter whose outputs change one bit at a time, a converter from excess 3 back to BCD.

What these problems cover

  • Binary, octal, hexadecimal and binary fractions
  • BCD and excess 3 codes, and converting between them
  • Gray code and why encoders and FIFOs use it
  • Sign magnitude, one's complement and two's complement
  • Overflow in signed and unsigned addition

Free to start

Solve these with a free account. Every other statement on this page is free to read.

Problems by track

Digital Foundations32

20 more in the Digital Foundations track

Combinational Building Blocks3

Latches and Flip-Flops1

Counters19

7 more in the Counters track

Arithmetic and ALU Design4

Interview Circuit1

Datapath Design1

Memory and Storage1

Clock Domain Crossing and Synchronization6

More problems5

How your answer is checked

Circuit problems run on the circuit simulator against the problem's test vectors, clocked cycle by cycle when they are sequential. Verilog problems are compiled with Icarus Verilog and run against a testbench, with the waveform and the Yosys schematic beside the result. Analysis questions are checked against their answer key.

Questions

Are these conversion drills?
Some are, for the representations themselves. Most turn the representation into a circuit, such as a code converter or a counter that counts in that code, and check it on the simulator.