Download presentation
Presentation is loading. Please wait.
1
Hardware Implementations Gates and Circuits
2
Three Main Gates AND OR NOT
3
Gate Diagrams Example 1: [(today is Monday) AND (it is raining)] OR (it is snowing)
4
Gate Diagrams Example: What does it represent?
5
Gate Diagrams Example: {[(today is Monday) AND (it is raining)] OR (it is snowing)} AND {NOT [(it is raining) AND (it is snowing)]}
6
Truth Table to Gates First, build the Boolean algebra expression that gives Z Z = AB + A’B’ Z = (A AND B) OR (NOT A AND NOT B) ABZ TTT TFF FTF FFT
7
Truth Table to Gates Z = AB + A’B’ Next, build the circuit that goes with the Boolean algebra expression Z ABZ TTT TFF FTF FFT
8
Z = AB + A’B’
9
Binary Arithmetic We can add binary numbers just like decimal numbers only using base two arithmetic. For example: 5101 1110 101 + 7+ 111 121100
10
Binary Addition Notice in addition: 0011 + 0+ 1+ 0 + 1 01110 FalseTrue False True Sum Carry ABSum (1) T (0) F (1) T(0) F(1) T (0) F(1) T (0) F
11
Sum and Carry ABCarry 111 100 010 000 ABSum 110 101 011 000
12
Sum Circuit ABSum 110 101 011 000 Sum = AB’ + A’B
13
Carry Circuit ABCarry 111 100 010 000 Carry = AB
14
Half Adder - Sum and Carry
15
Half Adder The sum digit is 0 if the sum is even. The sum digit is 1 if the sum is odd. The carry is 1 if the sum is greater than 1. Handles the case where we add two binary digits with no inward carry.
16
Full Adder Takes a carry in and produces the result and carry out. So, we have 3 inputs and two outputs. Combine two half-adders together with an OR gate to get a full adder for each binary digit. How many half adders would we need to add two 8-digit binary numbers? How many gates?
17
Full Adder
18
Subtraction ABSub 110 101 011 000 ABBorrow 110 100 011 000
19
Binary Subtraction We do binary subtraction like decimal subtraction only the borrowing is done in 2’s instead of 10’s. 12201111010 - 7- 00000111 11501110011
20
Subtraction as Addition If A = 01111010, B = 00000111, then using the twos-complement representation for –B, we have –B = 11111000 + 1 = 11111001 so 12201111010 - 7+ 11111001 11501110011
21
Binary Multiplication Again, just like decimal except we add and multiply in binary. *01 000 101 5101 x 7x 111 35100011
22
NAND Gates and NOT This gate represents (A NAND NOT B).
23
NAND Truth Table ABA NAND B TTF TFT FTT FFT
24
NAND Fact: All other gates (AND, OR, NOT) can be constructed using only NAND gates Verification:
25
Exercises Fill in a truth table and give a Boolean expression for the following circuits.
26
Exercises - How would you create a one binary digit multiplier? A two-digit by one-digit multiplier? A two-digit by two-digit multiplier? *01 000 101
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.