SLIDE 1
Tuesday, 17 November 2015 Return exams New sample NASM program in - - PowerPoint PPT Presentation
Tuesday, 17 November 2015 Return exams New sample NASM program in - - PowerPoint PPT Presentation
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
SLIDE 2
SLIDE 3
Adder
a b sum carry 1 1 1 1 1 1 1
sum = a xor b carry = ab This is called a “half adder”
SLIDE 4
Full Adder
a b carry in sum carry out 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
SLIDE 5
Full Adder
a b carry in sum carry out 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
sum = a xor b xor cin cout = a.b + a.cin + b.cin Let’s let logisim build this for us:
SLIDE 6
Full Adder
Select “Project/Analyze circuit” from the logisim menu
SLIDE 7
Full Adder
SLIDE 8
Using Full Adders
To add two 32-bit integers A = A31...A3A2A1A0 and B = B31...B3B2B1B0 to get sum S = S31...S3S2S1S0
...
… just string together 32 full adders:
By en:User:Cburnett [GFDL (http://www.gnu.
- rg/copyleft/fdl.html) or CC-BY-SA-3.0 (http:
//creativecommons.org/licenses/by-sa/3.0/)], via Wikimedia Commons
SLIDE 9
Another Useful Circuit: Multiplexer
A common need in designing is a circuit is to “select” an
- utput from two or more smaller circuits. For instance, we
may have a sub-circuit “A” that has the result of an “and”
- peration, 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:
A B A C = 0 A B B C = 1
SLIDE 10
Another Useful Circuit: Multiplexer
A B B C = 1 A B A C = 0
C A B OUT 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
SLIDE 11
Multiplexer in Logisim
SLIDE 12