1 ethics of computing mont 113g, spring 2012 session 5 binary addition
TRANSCRIPT
![Page 1: 1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649f495503460f94c6aacc/html5/thumbnails/1.jpg)
1
Ethics of Computing MONT 113G, Spring 2012
Session 5Binary Addition
![Page 2: 1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649f495503460f94c6aacc/html5/thumbnails/2.jpg)
2
Half adders and Full adders
A half adder adds 2 binary digits and outputs a sum and a carry bit.
A full adder adds 3 binary digits and outputs a sum and a carry bit.
These can be used together to add 2 binary integers.
![Page 3: 1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649f495503460f94c6aacc/html5/thumbnails/3.jpg)
3
Adding Binary Integers with Circuits
a7 a6 a5 a4 a3 a2 a1 a0+ b7 b6 b5 b4 b3 b2 b1 b0
a0b0
½adder
s0
a1b1
c0full adder
c1full adderb2
a2
s1
s2
c2
etc.
c0c1c2c3c4c5c6c7
s0s1s2s3s4s5s6s7
![Page 4: 1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649f495503460f94c6aacc/html5/thumbnails/4.jpg)
4
Universal Building Blocks
One can build any logical circuit with the following gates:2 input AND gate2 input OR gateInverter
In fact, one can build any logical circuit with just 1 type of gate:2 input NAND
![Page 5: 1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649f495503460f94c6aacc/html5/thumbnails/5.jpg)
5
Everything from NANDNOT
atrue
z = a
AND
ab z = a b
true
ORa
b
z = a V btrue
true
a true output0 1 11 1 0