Tuesday, 17 November 2015 Return exams New sample NASM program in repo Questions about projects or labs? Back to logic gates and circuits
Last Time We developed a table for a simple one-bit adder: a b sum carry 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1
Adder sum = a xor b a b sum carry carry = ab 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 This is called a “half adder”
Full Adder a b carry in sum carry out 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1
Full Adder a b carry in sum carry out sum = a xor b xor cin 0 0 0 0 0 cout = a.b + a.cin + b.cin 0 0 1 1 0 0 1 0 1 0 Let’s let logisim build this for 0 1 1 0 1 us: 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1
Full Adder Select “Project/Analyze circuit” from the logisim menu
Full Adder
Using Full Adders … just string together 32 To add two 32-bit integers full adders: A = A 31 ...A 3 A 2 A 1 A 0 and B = B 31 ...B 3 B 2 B 1 B 0 ... to get sum S = S 31 ...S 3 S 2 S 1 S 0 By en:User:Cburnett [GFDL (http://www.gnu. org/copyleft/fdl.html) or CC-BY-SA-3.0 (http: //creativecommons.org/licenses/by-sa/3.0/)], via Wikimedia Commons
Another Useful Circuit: Multiplexer A common need in designing is a circuit is to “select” an output from two or more smaller circuits. For instance, we may have a sub-circuit “A” that has the result of an “and” operation, another subcircuit “B” that has the result of an “or” operation, and a “control signal” “C” (either 0 or 1) that chooses one of these two results: C = 0 C = 1 A A A B B B
Another Useful Circuit: Multiplexer C A B OUT 0 0 0 0 C = 0 0 0 1 0 A 0 1 0 1 A B 0 1 1 1 1 0 0 0 1 0 1 1 C = 1 1 1 0 0 A B 1 1 1 1 B
Multiplexer in Logisim
Still Need to Add Slides for ... Karnaugh maps (see Thursday’s notes)
Recommend
More recommend