P7: 2-digit BCD adder
Due
2026-03-11T23:59
2026-03-11T23:59
Goals
- Demonstrate your knowledge of basic circuit design
- Learn an alternative number representation
Objective
Binary-coded decimal (BCD) is an alternative way to represent unsigned numbers. In BCD, each decimal digit is represented by its 4-bit unsigned binary representation. For example, we would encode the value 42 as 01000010 in BCD (as opposed to 101010 in binary).
You should implement a circuit that adds together two 2-digit BCD numbers. Your circuit does not need to handle invalid inputs – we will only test valid BCD values.
Requirements
- your work must be in a file called
bcd_adder.circ - your implementation must be in the
maincircuit (you are welcome to create sub-circuits however) - your circuit must have two inputs:
AandB AandBare both 8-bit values storing two digit BCD values- the circuit should have two outputs called
sumandovf sumshould be 8-bits and should store the two digit result of addingAandBovfshould be a 1-bit value indicating if the result generated overflow- you are restricted to
- input pins
- output pins
- splitters
- constants
- components in the Gates library (i.e., basic logic gates)
- components from the Plexers library
- components from the Arithmetic library
- you must include a text vector in a file called
bdc-test.txtthat provides sufficient tests to test the functionality of your circuit
Submission
Upload your .circ file and your test file to Gradescope.