Chapter 1
Chapter 1
ELEC261
Number Systems and Boolean Algebra
2
Digitaland
Digital andanalogue
analog
3
Digitaland
Digital andanalogue
analog (Cont’d)
(Cont’d)
6
Decimal
Decimal
Example
• Total units:
(1x104)+(0x103)+(3x102)+(6x101)+(2x100)
• DECIMAL number: 1036210
7
Hexadecimal
Hexadecimal
• Total units:
(1x164)+(4x163)+(0x162)+(11x161)+(15x160)
• HEX number: 140BFH = 8211110
8
Octal
Octal
Example
9
Binary
Binary
Example
10
Binary (Cont’d)
Binary (Cont’d)
11
Binary-Coded-Decimal (BCD)
Binary-Coded-Decimal (BCD)
Example
13
Conversion: Binary
Conversion: Binary to
to HEX
HEX
• Divide up into groups of four starting from the far right (leading zeros
Step 2 can be added to the last group to make up four bits if necessary)
Example 10110101
step 1:
step 4: B 5
15
Conversion: Binary
Conversion: Binary to
to Octal
Octal
• Divide up into groups of three starting from the right (leading zeros
Step 2 can be added to the last group to make up three bits if necessary)
Example
step 1: 10110101
step 3: 2 6 5
16
Conversion: Binary to Decimal
F D
Binary to HEX HEX to Decimal
17
Conversion: Decimal
Conversion: Decimal to
to Binary
Binary
• Read the remainders in reverse order (starting with the last one)
Step 3
Example
60 / 2 = 30 remainder 0 LSB
30 / 2 = 15 remainder 0
6010 = ?2 15 / 2 = 7 remainder 1 6010 = 1111002
7 / 2 = 3 remainder 1
3 / 2 = 1 remainder 1
1 / 2 = 0 remainder 1 MSB
18
Voltage level
Voltage level representation
representation of
of binary
binary numbers
numbers
Example
Level 1 1 0 1 0 0 1 0
voltages +5 V +5 V 0V +5 V 0V 0V +5 V 0V
19
Combinational and
Combinational and sequential
sequential logic
logic
Digital electronics is classified into:
o Combinational logic
o Sequential logic
Combinational logic: output is a function of, and only of, a
COMBINATION of the present inputs
Sequential logic : output depends not only on the present
inputs but also on the past history (or SEQUENCE) of the inputs
o It has storage (memory)
outputs
Inputs
Combinational
logic Memory
element
20
Logic functions
Logic functions and
and logic
logic gates
gates
21
Truth tables
Truth tables
o For a binary logic system with a number of inputs ‘n’ , there are
N possible combinations of inputs
o In order to be a complete description of the logic function, a truth
table must contain N rows where N is given by:
N = 2n input combinations
22
Truth table entries
Since a binary logic system has only two allowed states the
truth table must reflect this
In an electrical system, two different voltage levels are used to
represent these states
o The actual voltages depend on the type of technology (Logic
family) used
o Two widely accepted descriptions for the two states are shown
below (NO particular voltage levels are implied so these
descriptions are valid for ANY logic family)
23
‘NOT’ logic
‘NOT’ logic gate
gate (inverter)
(inverter)
Description of function
The X output is ‘1’ if input A is ‘0’
The output is the opposite (inverse) of the input
24
2-input ‘OR’
2-input ‘OR’ logic
logic gate
gate
Description of function
The output X is ‘1’ if input A is ‘1’
OR input B is ‘1’ (or both - inclusive OR)
25
2-input ‘NOR’
2-input ‘NOR’ (NOT-OR)
(NOT-OR) logic
logic gate
gate
Description of function
The output X is ‘1’ if neither input A is ‘1’
NOR input B is ‘1’
26
2-input ‘AND’
2-input ‘AND’ logic
logic gate
gate
Description of function
The output X is ‘1’ if input A is ‘1’ AND input B
is ‘1’
27
2-input ‘NAND’
2-input ‘NAND’ (NOT-AND)
(NOT-AND) logic
logic gate
gate
Description of function
The output X is NOT ‘1’ if input A is ‘1’ AND input
B is ‘1’
28
‘XOR’ or
‘XOR’ or ‘EXOR’
‘EXOR’ (Exclusive
(Exclusive OR)
OR) logic
logic gate
gate
Description of function
The output X is ‘1’ if input A is ‘1’ OR input B is ‘1’
but not both (exclusive OR)
29
‘XNOR’ or
‘XNOR’ or ‘EXNOR’
‘EXNOR’ (Exclusive
(Exclusive OR)
OR) logic
logic gate
gate
Truth Table
XNOR gate symbol
A B X
A
X
0 0 1
B A
X 0 1 0
B
Equivalent 1 0 0
1 1 1
Description of function
The output X is NOT ‘1’ if input A is ‘1’ OR input B
is ‘1’ but not both
30
Boolean Algebra
31
Boolean representation
Boolean representation of
of functions
functions
• = AND + = OR
⊕ = XOR 𝒇𝒇� = function ‘f’ inverted
(‘NOT f’ or ‘f BAR)
32
Fundamental Boolean
Fundamental Boolean relations
relations and
and operations
operations
33
Boolean reduction
Boolean reduction of
of logic
logic functions
functions
Logic functions may be reduced in complexity by the application
of the following Boolean algebraic laws:
Commutative: A+B = B+A
A.B = B.A
Associative: (A.B).C = A.(B.C)
(A+B)+C = A+(B+C)
Distributive: A.(B+C) = A.B+A.C
A+(B.C) = (A+B) . (A+C)
� +B
De Morgan’s Theorem: A.B = A �
A+B = A� .B
�
NB: De Morgan is easily remembered by saying:
“SPLIT THE LINE AND CHANGE THE SIGN” 35
Boolean reduction
Boolean reduction of
of logic
logic functions
functions (Cont’d)
(Cont’d)
Exercise
1. Use De Morgan’s theorem and Boolean algebra to verify the
following relation:
� .B=A+B
A+A
2. Reduce the following Boolean functions: Homework
a. f = A . B + A . B
� .B+A
b. f = A . B + A � .B
� +A.B
�
c. f = A � +A
� .C � .C+A
� .B
� +A.B
�
36
Boolean relations
Boolean relations from
from truth
truth tables
tables
37
Sum of
Sum of Products
Products (SOP)
(SOP)
• Establish a Boolean PRODUCT (AND) for each ROW in the truth
Step 1 table – this is called the BINARY CONNECTIVE
Example
Binary
ROW A B f State Connective
0 0 0 0 FALSE A�.B �
1 0 1 1 TRUE A �.B OR � .B+A.B
f=A �
2 1 0 1 TRUE A . B � =A⊕B
3 1 1 0 FALSE A.B
38
Product of
Product of Sums
Sums of
of (POS)
(POS)
• Establish the binary connectives as a Boolean SUM (OR) for each
Step 1 ROW of the truth table
A+B
�
A+B AND � + B)
f = (A + B) . (A �
�+B
A =A⊕B
�+B
A �
39
Shorthand definitions
Shorthand definitions for
for logic
logic functions
functions
40
Shorthand definitions
Shorthand definitions for
for logic
logic functions
functions (Cont’d)
(Cont’d)
Exercise
Using the following equation:
- Complete the truth table and write the function in set form
using the maxterms
- Write f(A,B,C) as a Boolean SOP and POS
41