Separation of Lanthanides/ Lanthanides and Actinides
LOGIC GATES - SARTHAK YADAV
1. Logic GatesLogic Gates
Made by- sarthak yadavMade by- sarthak yadav
Roll no-39Roll no-39
Class 12 A2Class 12 A2
11
2. Review of BooleanReview of Boolean
algebraalgebra
Just like Boolean logicJust like Boolean logic
Variables can only be 1 or 0Variables can only be 1 or 0
Instead of true / falseInstead of true / false
22
3. Review of BooleanReview of Boolean
algebraalgebra
Not is a horizontal bar above the numberNot is a horizontal bar above the number
0 = 10 = 1
1 = 01 = 0
Or is a plusOr is a plus
0+0 = 00+0 = 0
0+1 = 10+1 = 1
1+0 = 11+0 = 1
1+1 = 11+1 = 1
And is multiplicationAnd is multiplication
0*0 = 00*0 = 0
0*1 = 00*1 = 0
1*0 = 01*0 = 0
1*1 = 11*1 = 1
33
__
__
4. Review of BooleanReview of Boolean
algebraalgebra
Example: translate (Example: translate (xx++yy++zz)()(xyzxyz) to a Boolean) to a Boolean
logic expressionlogic expression
((xx∨∨yy∨∨zz))∧∧((¬¬xx∧¬∧¬yy∧¬∧¬zz))
We can define a Boolean function:We can define a Boolean function:
F(x,y) = (F(x,y) = (xx∨∨yy))∧∧((¬¬xx∧¬∧¬yy))
And then write a “truth table” for it:And then write a “truth table” for it:
44
__ __ __
x y F(x,y)
1 1 0
1 0 0
0 1 0
0 0 0
6. Converting betweenConverting between
circuits and equationscircuits and equations
Find the output of the following circuitFind the output of the following circuit
Answer: (Answer: (x+yx+y)y)y
Or (Or (xx∨∨yy))∧¬∧¬yy 66
x+y
y
(x+y)y
____
7. Converting betweenConverting between
circuits and equationscircuits and equations
Find the output of the following circuitFind the output of the following circuit
Answer: xyAnswer: xy
OrOr ¬¬((¬¬xx∧¬∧¬yy) ≡) ≡ xx∨∨yy 77
x
y
x y x y
_ __ _______
8. Converting betweenConverting between
circuits and equationscircuits and equations
Write the circuits for the followingWrite the circuits for the following
Boolean algebraic expressionsBoolean algebraic expressions
a)a) xx++yy
88
____
x x+y
9. Converting betweenConverting between
circuits and equationscircuits and equations
Write the circuits for the followingWrite the circuits for the following
Boolean algebraic expressionsBoolean algebraic expressions
b)b) ((xx++yy))xx
99
______________
x+y
x+y (x+y)x
13. A note on binaryA note on binary
numbersnumbers
In this slide set we are only dealing withIn this slide set we are only dealing with
non-negative numbersnon-negative numbers
The book (section 1.5) talks about two’s-The book (section 1.5) talks about two’s-
complement binary numberscomplement binary numbers
Positive (and zero) two’s-complement binaryPositive (and zero) two’s-complement binary
numbers is what was presented herenumbers is what was presented here
We won’t be getting into negative two’s-We won’t be getting into negative two’s-
complmeent numberscomplmeent numbers
1313
14. How to add binaryHow to add binary
numbersnumbers
Consider adding two 1-bit binary numbersConsider adding two 1-bit binary numbers xx andand yy
0+0 = 00+0 = 0
0+1 = 10+1 = 1
1+0 = 11+0 = 1
1+1 = 101+1 = 10
Carry isCarry is xx ANDAND yy
Sum isSum is xx XORXOR yy
The circuit to compute this is called a half-adderThe circuit to compute this is called a half-adder 1414
x y Carry Sum
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
15. The half-adderThe half-adder
Sum =Sum = xx XORXOR yy
Carry =Carry = xx ANDAND yy
1515
x y Carry Sum
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
16. Using half addersUsing half adders
We can then use a half-adder to computeWe can then use a half-adder to compute
the sum of two Boolean numbersthe sum of two Boolean numbers
1616
1 1 0 0
+ 1 1 1 0
010?
001
17. How to fix thisHow to fix this
We need to create an adder that can take aWe need to create an adder that can take a
carry bit as an additional inputcarry bit as an additional input
Inputs:Inputs: xx,, yy, carry in, carry in
Outputs: sum, carry outOutputs: sum, carry out
This is called a full adderThis is called a full adder
Will addWill add xx andand yy with a half-adderwith a half-adder
Will add the sum of that to theWill add the sum of that to the
carry incarry in
What about the carry out?What about the carry out?
It’s 1 if either (or both):It’s 1 if either (or both):
xx++yy = 10= 10
xx++yy = 01 and carry in = 1= 01 and carry in = 1
1717
x y c carry sum
1 1 1 1 1
1 1 0 1 0
1 0 1 1 0
1 0 0 0 1
0 1 1 1 0
0 1 0 0 1
0 0 1 0 1
0 0 0 0 0
18. The full adderThe full adder
The “HA” boxes areThe “HA” boxes are
half-addershalf-adders
1818
x y c s1 c1 carry sum
1 1 1 0 1 1 1
1 1 0 0 1 1 0
1 0 1 1 0 1 0
1 0 0 1 0 0 1
0 1 1 1 0 1 0
0 1 0 1 0 0 1
0 0 1 0 0 0 1
0 0 0 0 0 0 0
s1
c1
19. The full adderThe full adder
The full circuitry of the full adderThe full circuitry of the full adder
1919
20. Adding bigger binaryAdding bigger binary
numbersnumbers
Just chain full adders togetherJust chain full adders together
2020
...
21. Adding bigger binaryAdding bigger binary
numbersnumbers
A half adder has 4 logic gatesA half adder has 4 logic gates
A full adder has two half adders plus a OR gateA full adder has two half adders plus a OR gate
Total of 9 logic gatesTotal of 9 logic gates
To addTo add nn bit binary numbers, you need 1 HAbit binary numbers, you need 1 HA
andand nn-1 FAs-1 FAs
To add 32 bit binary numbers, you need 1 HATo add 32 bit binary numbers, you need 1 HA
and 31 FAsand 31 FAs
Total of 4+9*31 = 283 logic gatesTotal of 4+9*31 = 283 logic gates
To add 64 bit binary numbers, you need 1 HATo add 64 bit binary numbers, you need 1 HA
and 63 FAsand 63 FAs
Total of 4+9*63 = 571 logic gatesTotal of 4+9*63 = 571 logic gates 2121
22. More about logic gatesMore about logic gates
To implement a logic gate in hardware,To implement a logic gate in hardware,
you use a transistoryou use a transistor
Transistors are all enclosed in an “IC”, orTransistors are all enclosed in an “IC”, or
integrated circuitintegrated circuit
The current Intel Pentium IV processorsThe current Intel Pentium IV processors
have 55 million transistors!have 55 million transistors!
2222
24. MemoryMemory
A flip-flop holds a single bit of memoryA flip-flop holds a single bit of memory
The bit “flip-flops” between the two NANDThe bit “flip-flops” between the two NAND
gatesgates
In reality, flip-flops are a bit moreIn reality, flip-flops are a bit more
complicatedcomplicated
Have 5 (or so) logic gates (transistors) per flip-Have 5 (or so) logic gates (transistors) per flip-
flopflop
Consider a 1 Gb memory chipConsider a 1 Gb memory chip
1 Gb = 8,589,934,592 bits of memory1 Gb = 8,589,934,592 bits of memory
That’s about 43 million transistors!That’s about 43 million transistors!
In reality, those transistors are split into 9In reality, those transistors are split into 9
ICs of about 5 million transistors eachICs of about 5 million transistors each
2424
25. HexadecimalHexadecimal
A numerical rangeA numerical range
from 0-15from 0-15
Where A is 10, B is 11,Where A is 10, B is 11,
… and F is 15… and F is 15
Often written with aOften written with a
‘0x’ prefix‘0x’ prefix
So 0x10 is 10 hex, orSo 0x10 is 10 hex, or
1616
0x100 is 100 hex, or0x100 is 100 hex, or
256256
Binary numbers easilyBinary numbers easily
translate:translate: 2525
26. DEADBEEFDEADBEEF
Many IBM machines would fill allocatedMany IBM machines would fill allocated
(but uninitialized) memory with the hexa-(but uninitialized) memory with the hexa-
decimal pattern 0xDEADBEEFdecimal pattern 0xDEADBEEF
Decimal -21524111Decimal -21524111
Makes it easier to spot in a debuggerMakes it easier to spot in a debugger
2626