====== Lab Work 2 (Part 2) ====== ====== Adders and Comparators ====== One of the most useful combinational logic circuit is an adder. It is the core component of any Arithmetic Unit - used in binary multipliers and even floating-point arithmetic units. Meanwhile, a comparator is useful as a decision making circuitry - it usually compares the magnitude of two binary values. ====== Half-Adder ====== A half-adder sums two 1-bit values and provides two 1-bit values (sum and carry). ^ Half-Adder ^^ | Symbol | Truth Table | | {{:archive:pgt104:hadd_block.jpg?direct&0x150|Block Symbol}} | {{:archive:pgt104:hadd_table.jpg?direct&0x150|Truth Table}} | //**Disclaimer**: The images above are extracted from resources available for Digital Fundamentals 11th Edition (Global Edition)// ====== Full-Adder ====== A full-adder sums three 1-bit values and provides two 1-bit values (sum and carry). ^ Full-Adder ^^ | Symbol | Truth Table | | {{:archive:pgt104:fadd_block.jpg?direct&0x150|Block Symbol}} | {{:archive:pgt104:fadd_table.jpg?direct&0x150|Truth Table}} | //**Disclaimer**: The images above are extracted from resources available for Digital Fundamentals 11th Edition (Global Edition)// ====== Comparator ====== There are three possible output bits of a comparator (depending on application requirement): equality (''==''), less than (''<'') and greater than (''>''). ^ Comparator Output ^ Description ^ | EQ (''=='') | Output is at logic HI when the first value is exactly the same as the second value | | LT (''<'') | Output is at logic HI when the first value is less than the second value | | GT (''>'') | Output is at logic HI when the first value is greater then the second value | Truth Table for a 1-bit Comparator: ^ A ^ B ^ EQ ^ LT ^ GT ^ | 0 | 0 | 1 | 0 | 0 | | 0 | 1 | 0 | 1 | 0 | | 1 | 0 | 0 | 0 | 1 | | 1 | 1 | 1 | 0 | 0 | //**Note**: A 2-bit comparator cannot be built by simply cascading two 1-bit logic circuits.// ====== Things To Do ====== **THING 1** Build a 1-bit half-adder circuit and verify. **THING 2** Build a 1-bit full-adder circuit using 2x1-bit half-adders. Verify. //Trivia: What is the least number of ICs (of 2-input logic gates) needed to implement this?// **THING 3** (Optional?) Build a 2-bit adder and verify. **THING 4** (Optional?) Construct a truth table for 1-bit subtractor. Build the circuit and verify. **THING 5** (Optional?) Build a 4-bit ripple carry adder and verify. **THING 6** (Optional?) Build a 4-bit carry look ahead (CLA) adder and verify. **THING 7** Construct a truth table for 2-bit comparator (3 outputs). Get the Boolean expression for each output. Build the circuit and verify. **THING 8** (Optional?) Build a 4-bit comparator (3 outputs) and verify. //ask your instructor for more...//