Lecture 11 Electronics
Lecture 11 Electronics
Number systems.
Decimal
• Decimal number system is base (radix) 10.
• Therefore has 10 different digits.
• 3586.265
• 3586 = 6×100 +8×101+5×102 +3×103 = 6+80+500+3000 = 3586
• The fractional part.
• 265 = 2×10−1+6×10−2 +5×10−3 = 0.2+0.06+0.005 = 0.265
Binary
• Binary number system is base -2 with ‘0’ and ‘1’ as the two
independent digits.
• Bit is an abbreviation of the term ‘binary digit’ and the smallest unit
of information.
• A byte is a string of eight bits, and is the basic unit of data.
• We also have computer word
Binary Addition and Subtraction
• Rules for addition • Rules for subtraction
• 0+0=0 • 0–0=0
• 0+1=1 • 1–0=1
• 1+0=1 • 0 – 1 = 1 (with a borrow of 1)
• 1 + 1 = 0 (with a carry of 1) • 1–1=0
Binary Multiplication and Division
Decimal # 13 ÷ 2 = 6 remainder 1
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
1 1 0 1
• Fractional part = .375
• 0.375*2=0.75 with a carry 0
• 0.75*2=0.5 with a carry of 1
• 0.5*2= 0 with a carry of 1
• Therefore (0.375)10=(.011)2
Decimal-to-octal conversion
• The progressive division in this case of the integer part and the
progressive multiplication of the fractional part are by ‘8’.
Binary-to-hexadecimal ?
Octal-to-hexadecimal ?
• This is known as the 8421 BCD code starting from MSB to the LSB
• Find out about other BCD codes ?
Gray code
• It was designed by Frank Gray at Bell Labs and patented in 1953.
• It is an unweighted binary code in which two successive values differ
by 1 bit.
Gray code-binary conversion ?
Binary arithmetic ?
Gate
A device that performs a basic operation on
electrical signals
Circuits
Gates combined to perform more
complicated tasks
22
Computers and Electricity
How do we describe the behavior of gates and circuits?
Boolean expressions
Uses Boolean algebra, a mathematical notation for expressing
two-valued logic
Logic diagrams
A graphical representation of a circuit; each gate has its
own symbol
Truth tables
A table showing all possible input value and the associated
output values
23
Gates
Six types of gates
• NOT
• AND
• OR
• XOR
• NAND
• NOR
Typically, logic diagrams are black and white with gates
distinguished only by their shape
We use color for emphasis (and fun)
24
Logic Gates
• In this section, we see that Boolean functions are
implemented in digital computer circuits called gates.
• A gate is an electronic device that produces a result
based on two or more input values.
• In reality, gates consist of one to six transistors, but digital
designers think of them as a single unit.
• Integrated circuits contain collections of gates suited to a
particular purpose.
NOT Gate
A NOT gate accepts one input signal (0 or 1) and returns
the opposite signal as output
26
AND Gate
An AND gate accepts two input signals
If both are 1, the output is 1; otherwise,
the output is 0
27
OR Gate
An OR gate accepts two input signals
If both are 0, the output is 0; otherwise,
the output is 1
28
XOR Gate
An XOR gate accepts two input signals
If both are the same, the output is 0; otherwise,
the output is 1
29
XOR Gate
Note the difference between the XOR gate
and the OR gate; they differ only in one
input situation
When both input signals are 1, the OR gate produces a 1
and the XOR produces a 0
30
NAND Gate
The NAND gate accepts two input signals
If both are 1, the output is 0; otherwise,
the output is 1
32
Logic Gates
36
Combinational Circuits
• We have designed a circuit that implements the
Boolean function:
39
Combinational Circuits
40
Combinational Circuits
Consider the following Boolean expression A(B + C)
41