Dlca 22itc01 Unit 1
Dlca 22itc01 Unit 1
FACULTY: E RAMALAKSHMI
UNIT-II
Data Representation
Data Types
Registers contain either data or control information
Control information is a bit or group of bits used to specify the sequence of
command signals needed for data manipulation
Data are numbers and other binary-coded information that are operated on
Possible data types in registers:
o Numbers used in computations
o Letters of the alphabet used in data processing
o Other discrete symbols used for specific purposes
All types of data, except binary numbers, are represented in binary-coded form
A number system of base, or radix, r is a system that uses distinct symbols for r
digits
Numbers are represented by a string of digit symbols
The string of digits 724.5 represents the quantity
7 x 102 + 2 x 101 + 4 x 100 + 5 x 10-1
The string of digits 101101 in the binary number system represents the quantity
1 x 25 + 0 x 24 + 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 45
(101101)2 = (45)10
We will also use the octal (radix 8) and hexidecimal (radix 16) number systems
(736.4)8 = 7 x 82 + 3 x 81 + 6 x 80 + 4 x 8-1 = (478.5)10
(F3)16 = F x 161 + 3 x 160 = (243)10
Conversion from decimal to radix r system is carried out by separating the
number into its integer and fraction parts and converting each part separately
Divide the integer successively by r and accumulate the remainders
Multiply the fraction successively by r until the fraction becomes zero
Each octal digit corresponds to three binary digits
Each hexadecimal digit corresponds to four binary digits
Rather than specifying numbers in binary form, refer to them in octal or
hexadecimal and reduce the number of digits by 1/3 or ¼, respectively
A binary code is a group of n bits that assume up to 2n distinct combinations
A four bit code is necessary to represent the ten decimal digits – 6 are unused
The most popular decimal code is called binary-coded decimal (BCD)
BCD is different from converting a decimal number to binary
For example 99, when converted to binary, is 1100011
99 when represented in BCD is 1001 1001
The standard alphanumeric binary code is ASCII
This uses seven bits to code 128 characters
Binary codes are required since registers can hold binary information only
Complements
Complements are used in digital computers for simplifying subtraction and logical
manipulation
Two types of complements for each base r system: r’s complement and (r – 1)’s
complement
Given a number N in base r having n digits, the (r – 1)’s complement of N is
defined as (rn – 1) – N
For decimal, the 9’s complement of N is (10n – 1) – N
The 9’s complement of 546700 is 999999 – 546700 = 453299
The 9’s complement of 453299 is 999999 – 453299 = 546700
For binary, the 1’s complement of N is (2n – 1) – N
The 1’s complement of 1011001 is 1111111 – 1011001 = 0100110
The 1’s complement is the true complement of the number – just toggle all bits
M = 72352
10’s comp. of N = +86750
Sum = 159282
Discard end carry = -100000
Answer = 59282
Example for M < N: 13250 – 72532 = -59282
M = 13250
10’s comp. of N = +27468
Sum = 40718
No end carry
Answer = -59282 (10’s comp. of 40718)
Example for X = 1010100 and Y = 1000011
X = 1010100
2’s comp. of Y = +0111101
Sum = 10010001
Discard end carry = -10000000
Answer X – Y = 0010001
Y = 1000011
2’s comp. of X = +0101100
Sum = 1101111
No end carry
Answer = -0010001 (2’s comp. of 1101111)
Fixed-Point Representation
An overflow occurs when two numbers of n digits each are added and the sum
occupies n + 1 digits
Overflows are problems since the width of a register is finite
Therefore, a flag is set if this occurs and can be checked by the user
Detection of an overflow depends on if the numbers are signed or unsigned
For unsigned numbers, an overflow is detected from the end carry out of the msb
For addition of signed numbers, an overflow cannot occur if one is positive and
one is negative – both have to have the same sign
An overflow can be detected if the carry into the sign bit position and the carry
out of the sign bit position are not equal
Floating-Point Representation
The 2421 code and the excess-3 code are both self-complementing
The 9’s complement of each digit is obtained by complementing each bit in the
code
The 2421 code is a weighted code
The bits are multiplied by indicated weights and the sum gives the decimal digit
The excess-3 code is obtained from the corresponding BCD code added to 3
The P(odd) bit is chosen to make the sum of 1’s in all four bits odd
The even-parity scheme has the disadvantage of having a bit combination of all
0’s
Procedure during transmission:
o At the sending end, the message is applied to a parity generator
o The message, including the parity bit, is transmitted
o At the receiving end, all the incoming bits are applied to a parity checker
o Any odd number of errors are detected
Parity generators and checkers are constructed with XOR gates (odd function)
An odd function generates 1 iff an odd number if input variables are 1
Number systems
When we type some letters or words, the computer translates
them in numbers as computers can understand only numbers.
A computer can understand positional number system where
there are only a few symbols called digits and these symbols
represent different values depending on the position they
occupy in the number.
A value of each digit in a number can be determined using
The digit
The position of the digit in the number
The base of the number system (where base is defined as
the total number of digits available in the number system).
2
S.N. Number System and Description
Decimal number system
1
Base 10, Digit used : 0 to 9
Octal Number System
2
Base 8. Digits used : 0 to 7
last position - 1
Example :-
Binary Number : 101012
Calculating Decimal Equivalent:
Step Binary Number Decimal Number
Step 1 101012=((1 x 24)+(0 x 23)+(1 x 22)+(0 x 21)+(1 x 20))10
Step 2 101012 = (16 + 0 + 4 + 0 + 1)10
Step 3 101012 = 2110
6
Applications of Binary Number System
last position - 1.
Example :-
Octal Number : 125708
Calculating Decimal Equivalent:
Step Octal Number Decimal Number
Step 1 125708 =((1 x 84)+(2 x 83)+(5 x 82)+(7 x 81)+(0 x 80))10
Step 2 125708 =(4096 + 1024 + 320 + 56 + 0)10
Step 3 125708 =549610
8
Applications of Octal Number System
• The octal numbers are not as common as
they used to be.
• Octal is used when the number of bits in
one word is a multiple of 3.
• It is also used as a shorthand for
representing file permissions on UNIX
systems and representation of UTF8
numbers, etc.
Advantages and Disadvantages
• The main advantage of using Octal numbers is that it
uses less digits than decimal and Hexadecimal number
system. So, it has fewer computations and less
computational errors.
• It uses only 3 bits to represent any digit in binary and
easy to convert from octal to binary and vice-versa. It
is easier to handle input and output in the octal form.
• Disadvantage of Octal number system is that computer
does not understand octal number system directly, so
we need octal to binary converter.
Hexadecimal Number
system
Characteristics of Hexadecimal number system are
as follows:
Uses 10 digits and 6 letters, 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
Letters represents numbers starting from 10. A = 10. B = 11, C =
12, D = 13, E = 14, F = 15.
Also called base 16 number system
Each position in a hexadecimal number represents a 0 power of
the base (16). Example 160
COMPL
UTEa
R Fs
UNt pENoTALsition
DAM in a hexadecimal number represents a x power of
9
the base (16). Example 16x where x represents the last position -
Example :-
Hexadecimal Number : 19FDE16
Calculating Decimal Equivalent:
Step Binary Number Decimal Number
Step 1 19FDE16 =((1 x 164)+(9 x 163)+(F x 162)+(D x 161)+(E x 160))10
Step 2 19FDE16= ((1 x 164)+(9 x 163)+(15 x 162)+(13x 161)+(14x 160))10
Step 3 19FDE16 =(65536+ 36864 + 3840 + 208 + 14)10
Step 4 19FDE16 =10646210
10
Advantages and Disadvantages
• It uses less memory to store more numbers, for example it store
256 numbers in two digits whereas decimal number stores 100
numbers in two digits.
• This number system is also used to represent Computer memory
addresses. It uses only 4 bits to represent any digit in binary and
easy to convert from hexadecimal to binary and vice-versa.
• It is easier to handle input and output in the hexadecimal form.
There is wide number of advantages in data science field,
artificial intelligence and machine learning.
• Disadvantage: It may not an easy to read and write for people,
and also difficult to perform operations like multiplications,
divisions using hexadecimal number system. Hexadecimal
numbers is most difficult number system for dealing with
Computer’s data.
Applications of Hexadecimal Number System
11
Decimal to Other Base
System
Step 1 - Divide the decimal number to be converted by the value
of the new base.
Step 2 - Get the remainder from Step 1 as the rightmost digit
(least significant digit) of new base number.
Step 3 - Divide the quotient of the previous divide by the new
base.
Step 4 - Record the remainder from Step 3 as the next digit (to
the left) of the new base number.
Repeat Steps 3 and 4, getting remainders from right to left, until
the quotient becomes zero in Step 3.
The last remainder thus obtained will be the most significant digit
COMPUTER FUNDAMENTAL 12
Step 2 101012 28 58
Step 2 - Combine all the resulting binary groups (of 3 digits each) into a single
binary number.
Example:
Octal Number : 58
Calculating Binary Equivalent:
Step Octal Number Binary Number
Step 2 - Convert each group of four binary digits to one hexadecimal symbol.
Example
steps
•Step 1 - Convert each hexadecimal
digit to a 4 digit binary number (the
hexadecimal digits may be treated
as decimal for this conversion).
•Step 2 - Combine all the resulting
binary groups (of 4 digits each) into
a single binary number.
Example
Hexadecimal Number : 1516
Calculating Binary Equivalent:
Step Hexadecimal Number Binary Number
FACULTY: E RAMALAKSHMI
Digital Logic &
Computer Architecture
Digital Electronics is a branch of Electronics
which deals with Digital systems and signals.
Digital system is a device or machine
which deals with 0’s and 1’s.
Any device that uses digital information
uses digital electronics
The work with digital domain is efficient than
analog domain.
All real life signals are analog.
How we can process it by using digital
system?
We have two analog interface.
First one is the input interface.
Second one is the output interface.
There will be a transducer and an anti-
transducer .
There is also a digital system.
Analog to Digital convertor
Sub Systems
Modules
• CPU
• Memory
• Program Memory(ROM)
• Data Memory(RAM)
• I/O Device
• Input Device: Keyboard, Mouse, Scanner
• Output Device: Printer, Plotter, Display
• Storage Device(I/O): FDD, HDD, MOD
Computer Organization
6
• A variety of logic gates are commonly used in
digital computer systems.
• Each gate has a distinct graphic symbol and its
operation can be described by means of an
algebraic expression.
• The input-output relationship of the binary
variables for each gate can be represented in
tabular form by a truth table.
NOT Gate
9
OR Gate
• An OR gate accepts two input signals
• If both inputs are 0, the output is 0; otherwise, the
output is 1
11
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
• XOR is called the exclusive OR
12
NAND Gate
• The NAND gate accepts two input signals
• If both inputs are 1, the output is 0; otherwise, the
output is 1
14
Review of Gate Processing
A NOT gate inverts its single input
An AND gate produces 1 if both input values are 1
An OR gate produces 0 if both input values are 0
An XOR gate produces 0 if input values are the same
A NAND gate produces 0 if both inputs are 1
A NOR gate produces a 1 if both inputs are 0
15
Gates with More Inputs
• Gates can be designed to accept three or more input values
• A three-input AND gate, for example, produces an output of 1
only if all input values are 1
17
Logic Gates
Logic Gates
Classification
• Basic Gates
• Universal gates
• Arithmetic Gates
Circuits
• Gates are combined into circuits by using the output
of one gate as the input for another
21
Combinational Circuits
22
Combinational Circuits
24
Circuit equivalence
• Two circuits that produce the same output for
identical input
25
Boolean Algebra
Boolean Algebra
F= x +y1z
• The function F is equal to 1 if x is 1 or if
both y' and z are equal to 1
• F is equal to 0 otherwise
• y' = 1 is equivalent to saying that y = 0
• => F is equal to 1, if x or if yz = 01,
Example for Boolean function
F= x +y1z
• A Boolean function can be transformed from
an algebraic expression into a logic diagram
composed of AND, OR, and inverter gates
F= x +y1z
Boolean Algebra
A Simple Proposition
Boolean Algebra
Truth Table
Boolean Algebra
U=R+F
Boolean equation
Boolean Algebra
1
Boolean Algebra
1
Boolean Algebra
U = C’. (W + R)
1
Boolean Algebra
U = C’. (W + R)
1
purpose of Boolean algebra
1
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)
1
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)
F = X Y (Z + Z) + X Y (Identity)
=1
1
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)
F = X Y (Z + Z) + X Y (Identity)
=1
F = XY+ XY
1
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)
F = X Y (Z + Z) + X Y (Identity)
=1
F = XY+ XY
F = (X + X) Y (Distributive Law)
2
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)
F = X Y (Z + Z) + X Y (Identity)
=1
F = XY+ XY
F = (X + X) Y (Distributive Law)
F = (X + X) Y (Identity)
=1
2
Boolean Laws and Identities
Reduce the boolean function F = X Y Z + X Y + X Y Z
F = X Y (Z + Z) + X Y (Distributive and Commutative Laws)
F = X Y (Z + Z) + X Y (Identity)
=1
F = XY+ XY
F = (X + X) Y (Distributive Law)
F = (X + X) Y (Identity)
=1
F =Y
2
Example1
P.T (AB+C)(AB+D)=AB+CD
AB.AB+AB.D+C.AB+C.D
AB+ABD+ABC+CD {A.A=A}
AB(1+D)+ABC+CD {1+A=1}
AB+ABC+CD
AB(1+C)+CD
AB+CD
Example 2
AB' + C1D
Example 3
F = ABC + ABC1+A'C
F = AB + C'D' B1D
F1= (A1+B1)(C+D)(B+D1)
Two Graphic Symbols for NOR gate
Two Graphic Symbols for NAND gate
Universal Gates
X + Y =X·Y X · Y = X + Y
X Y X·Y X+Y X Y X+Y X · Y X·Y X+Y
0 0 0 0 1 1 1 1 1 1
0 1 0 1 1 0 0 0 1 1
1 0 0 1 0 1 0 0 1 1
1 1 1 1 0 0 0 0 0 0
• Generalized DeMorgan’s Theorem:
X1 + X2 + … + Xn = X1 · X2 · … · Xn
X1 · X2 · … · Xn = X1 + X2 + … + Xn
Sum of product (SOP) Form
&
Product of sum (POS) Form
F= x +y1z
• The sum-of-products (SOP) form is a method
or form of simplifying the Boolean
expressions of logic gates.
• Sum and product derived from the symbolic
representations of the OR and AND functions.
• OR (+) , AND ( . ) , addition and multiplication.
Sum
Product terms
• When two or more sum terms are multiplied
by a Boolean OR operation.
• Sum terms are defined by using OR operation
and the product term is defined by using AND
operation.
Product
Sum terms
• The canonical forms are the special cases of
SOP and POS forms.
• These are also known as standard SOP and
POS forms.
• In SOP or POS form, all individual terms do not
involve all literals.
• For example AB + A’BC the first product term
do not contain literal C.
• If each term in SOP or POS contain all literals
then the expression is known as standard or
canonical form.
• Each individual term in the POS form is called Maxterm.
• Each individual term in the SOP form is called Minterm.
• In Minterm, we look for the functions where the output
results is “1”.
• while in Maxterm we look for function where the output
results is “0”.
• We perform Sum of minterm also known as Sum of products
(SOP) .
• We perform Product of Maxterm also known as Product of
sum (POS).
Step 1: Find the missing literal in each product
term if any.
Step 2: And each product term having missing
literals with terms form by ORing the literal and
its complement.
Step 3: Expand the term by applying,
distributive law and reorder the literals.
Step 4: Reduce the repeated product terms.
Because A + A = A
f (A,B,C) = AB + BC + AC
Step 1: Find the missing literals in each product
term.
f (A,B,C) = AB + BC + AC
Literal B is missing
Literal A is missing
Literal C is missing
Step 2: AND the product term with missing literal + its
complement.
f (A,B,C) = AB . (C+C’) + BC . (A+A’) + AC . (B+B’)
f (A,B,C) = (A + B) . (B + C) . (A + C)
Literal B is missing
Literal A is missing
Literal C is missing
f(A,B,C)=(A+B+C).(A+B+C’).(A+B+C).(A’+B+C).(A+B+C).(A+B’+C)
f(A,B,C)=(A+B+C).(A+B+C’).(A’+B+C).(A+B’+C)
• Minterms are AND terms with every variable present in
either true or complemented form.
• Given that each binary variable may appear normal
(e.g., x) or complemented (e.g.x’ ), there are 2n m
• Example: Two variables (X and Y)produce 2 x 2 = 4
combinations:
XY(both normal)
XY’(X normal, Y complemented)
X’Y(X complemented, Y normal)
X’Y’(both complemented)
Thus there are four minterms of two variables.
• Maxterms are OR terms with every variable in true or
complemented form.
• Given that each binary variable may appear normal
(e.g., x) or complemented (e.g. x’), there are 2n
maxterms for n variables.
• Example: Two variables (X and Y) produce 2x2=4
combinations:
X+Y(both normal)
X+Y’(x normal, y complemented)
X’+Y(x complemented, y normal)
X’+Y’(both complemented)
A B C Minterms Maxterms
0 0 0 A’B’C’ = m0 A+B+C = M0
0 0 1 A’B’C = m1 A+B+C’ = M1
0 1 0 A’BC’ = m2 A+B’+C = M2
0 1 1 A’BC = m3 A+B’+C’ = M3
1 0 0 AB’C’ = m4 A’+B+C = M4
1 0 1 AB’C = m5 A’+B+C’ = M5
1 1 0 ABC’ = m6 A’+B’+C = M6
1 1 1 ABC = m7 A’+B’+C’ = M7
Minterms:
1. f(A,B,C) = A’B’C’ + A’BC’ + A’BC + ABC
= m0 + m2 + m3 + m7
= Σm(0,2,3,7)
2. f(A,B,C)= A’B’C + A’BC + AB’C + ABC
= m1 + m3 + m5 + m7
= Σm(1,3,5,7)
3. f(A,B,C)= A’B’C’ + A’BC’ + A’BC + ABC’
= m0 + m2 + m3 + m6
= Σm(0,2,3,6)
1. f(A,B,C) = (A+B+C).(A+B’+C).(A+B’+C’).(A’+B’+C’)
= M0 + M2 + M3 + M7
= ΠM(0,2,3,7)
2. f(A,B,C)= (A+B+C’).(A+B’+C’).(A+B’+C’).(A’+B’+C’)
= M1 + M3 + M5 + M7
= ΠM (1,3,5,7)
3. f(A,B,C)= (A+B+C).(A+B’+C).(A+B’+C’).(A’+B’+C)
= M0 + M2 + M3 + M6
= ΠM (0,2,3,6)
Map Simplification
Karnaugh map
• The Karnaugh map, also known as the K-map, is an alternative
method to simplify boolean algebra expressions.
N o zeros allowed.
N o diagonals.
O n l y power of 2 number of cells in eachgroup.
Groups should be as large as possible.
Eve r y one must be in at least onegroup.
Overlapping allowed.
Wr a p aroundallowed.
Fewest number of groups possible.
Examples
Example 1
AC
A B C Y
0 0 0 1 AB
C 00 01 11 10
0 0 1 1
0 1 0 0 0 1 1 1
0 1 1 0
1 0 0 1 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0 B
B AC
Exercise
F(A,B,C) = ∑(3,4,6,7)
Solution
Exercise
F(A, B, C) = ∑(0, 2, 4, 5, 6)
Solution
Exercise
• The 1's in the map represent the minterms that produce 1 for
the function.
• The squares not marked by 1 represent the minterms that
produce 0 for the function.
• mark the empty squares with O's and combine them into
groups of adjacent squares and obtain the complement of the
function, F'
• Taking the complement of F' produces an expression for F in
product-of-sums form.
Examples
Exercise
Solution: POS form
• The 1's and O's in the map represent the minterms that make
the function equal to 1 or 0.
• There are occasions when it does not matter if the function
produces 0 or 1 for a given minterm.
• Since the function may be either 0 or 1, we say that we don't
care what the function output is to be for this minterm.
• Minterms that may produce either 0 or 1 for the function are
said to be don't-care conditions and are marked with an x in
the map.
• These don't-care conditions can be used to provide further
simplification of the algebraic expression.
Don't'Care Conditions
• F(A, B, C) = ∑(0, 2, 6)
d(A,B,C) = ∑(1,3,5)
Solution