Course Objectives: Lojik Devreler 1
Course Objectives: Lojik Devreler 1
Lojik Devreler
Lojik Devreler
This is getting
boring..
Lojik Devreler
Input1
Output
Lojik Devreler
OR Gate
Input1
Output
Input2
Output is low if both inputs are low
Lojik Devreler
Basic Gates
AND
of two inputs
OR of two
inputs
NOT
(complement)
on one input
Logic gate:
Two Questions:
How can we implement such switches?
What can we build with Gates? And How?
Lojik Devreler
Lojik Devreler
Lojik Devreler
Lojik Devreler
Decimal review
These weights are all powers of the base, which is 10. We can rewrite
this:
1
6
2
.
3
7
5
Digits
102
101
100
10-1
10-2
10-3
Weights
To find the decimal value of a number, multiply each digit by its weight
and sum the products.
(1 x 102) + (6 x 101) + (2 x 100) + (3 x 10-1) + (7 x 10-2) + (5 x 10-3) = 162.375
Now we can see why addition is easier with decimal system than
the roman system. The idea of positional weights and carry!
Lojik Devreler
10
Decimal system (and the idea of 0) was invented in India around 100500AD
Why did they use 10? Anything special about it?
Not really.
Probably the fact that we have 10 fingers influenced this
Will a base other than 10 work?
Sure: 345 in base 9 = 5 +9*4 + 92 *3 = 284 in base 10
Base 9 has only 9 symbols: 1, 2, 3, 4, 5, 6, 7, 8, 0
What about base 2? (1 and 0)
1101 in base 2: 1 + 2*0 + 4*1 + 8*1 = 13
Base 2 system will work for our gates!
Base 2 Addition:
1
0
0
1
1
Compare this with decimal addition
Lojik Devreler
11
28 = 256
29 = 512
210 = 1024
Useful abbreviations:
K = 210 = 1,024
M = 220 = 1,048,576
G = 230 = 1,073,741,824
Lojik Devreler
12
1
1
1
1
most significant
bit (MSB)
1
0
1
0
0
1
1
0
1
0
1
(Carries)
(Augend)
(Addend)
(Sum)
least significant
bit (LSB)
Lojik Devreler
13
Lojik Devreler
14
Result
Output is 1 iff
exactly one of the 2
inputs is 1
Exclusive OR
Lojik Devreler
15
0
0
1
1
+0
+1
+0
+1
=0
=1
=1
= 10
Lojik Devreler
16
But what we really need to do is add three bits: the augend and addend,
and the carry in from the right.
1
+
1
1
1
1
Cin
Cout
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
1
1
0
1
1
0
1
0
0
1
1
0
1
0
0
0
0
0
1
1
1
1
0
1
1
0
1
0
1
+0
+0
+1
+1
+0
+0
+1
+1
+0
+0
+0
+1
+0
+1
+0
+1
= 00
= 01
= 01
= 10
= 01
= 10
= 10
= 11
Lojik Devreler
17
Why are these things called half adders and full adders?
You can build a full adder by putting together two half adders.
Lojik Devreler
18
A 4-bit adder
Lojik Devreler
19
Lets put our initial example into this circuit: A=1011, B=1110
1
1
1
1
0
Lojik Devreler
20
Lojik Devreler
21
Lojik Devreler
22
Data
ALU
(Arithmetic/Logic Unit:
Basic operations
Memory
Program
Lojik Devreler
23
Summary
Lojik Devreler
24