Wednesday, 2025-07-09, 8:58 AM |
|
|
Welcome Guest RSS |
Statistics |
|
|
Warezy Sponsors |  |
News topics |
Programming
[8]
Coding, Source-code, Tutorial, Problem Solving and more
|
Hardware
[5]
Hardware Info, Troubleshooting, Price, Performance and more
|
History
[4]
More Abou History... you must read here
|
Computer Tips
[1]
Computer Tipz
|
Internet
[1]
Internet news, tools, media, software and problem solving
|
Windows
[8]
Windows Tutorials
|
Mobile
[1]
Mobile trick, tips, tutorial, troubleshooting, hacking
|
News
[1]
News every day
|
Bloging
[0]
|
Newest
[0]
for every thing new posting
|
Games
[0]
Games sources
|
Business
[1]
Business
|
Hobby
[0]
|
Journey
[0]
|
Making Money
[0]
Making money online or offline
|
Troubleshooting
[0]
|
|
|
|

Main » 2009 » January » 8 » BOOLEAN LOGIC GATES - Part 6
BOOLEAN LOGIC GATES - Part 6 | 11:48 AM |
6.0 BINARY ADDITION
=======================================
So we all know how to add decimal numbers (im presuming), its easy
1 1 1
+ 1 + 2 + 3
--- --- ---
= 2 = 3 = 4
But how do we add in binary? Easy watch this
0 0 1 1
+ 0 + 1 + 0 + 1
--- --- --- ---
= 0 = 1 = 1 = 10
Thats fine but with 1+1 we get a carry over that we have to
deal with. So we add an extra space to handle the carry.
0 0 1 1
+ 0 + 1 + 0 + 1
--- --- --- ---
= 00 = 01 = 01 = 10
Lets write a truth table to handle this data.
A B | CO Q
-------+--------
0 0 | 0 0
0 1 | 0 1
1 0 | 0 1
1 1 | 1 0
Notice the new column on the truth table for the carry out (CO).
We now notice that CO and Q and familiar, C0 is the same as an AND
gate and Q is the same as an XOR.
A & B = Q
(A & ~B) | (~A & B) = CO
Thats fine for adding single bit numbers but what if we want to
add 2 8-bit numbers? In this case were going to need a component
called a full binary adder. Once we create the full adder we
can put 8 of them together to form an 8-bit or byte-wide adder
and move the carry bit from one adder to the next.
The main difference for us between the first adder and this
full adder is that we now need a third input called
a Carry-In(CI).
Heres the truth table for the full adder.
A B CI | CO Q
-------------+--------
0 0 0 | 0 0
0 0 1 | 0 1
0 1 0 | 0 1
0 1 1 | 1 0
1 0 0 | 0 1
1 0 1 | 1 0
1 1 0 | 1 0
1 1 1 | 1 1
If we examine the output youll realise that the top 4 numbers
for C0 look like an AND gate for A and B and the bottom 4 look
like an OR gate for A and B, while top 4 of Q look like an XOR
and the bottom 4 like an XNOR gate.
By putting those gates together we could form a form a more
complicated and useful circuit such as the adder and thats
how a computer builds up from a series of 1's and 0's to addition.
|
Category: Programming |
Views: 1250 |
Added by: Maintate
| Rating: 0.0/0 |
|
|
|