You are on page 1of 46

Digital Design

EC4010
Department of Computer Engineering,
Faculty of Engineering
University of Jaffna.
Contents of Course Unit.
1. Introduction to digital logic.
2. Boolean algebra and logic gates.
3. Gate level optimization.
4. Combinational logic circuits.
5. Sequential logic circuits and memory elements.
Contents of Course Unit (Cont’d)
6. Modular design of digital circuits.
7. Analysis and design of synchronous sequential circuits.
8. Analysis and design of asynchronous sequential circuits.
9. Digital circuit design and implementation.
References
• M. Morris Mano, and Michael D. Ciletti, Digital
Design with an Introduction to Verilog HDL,
VHDL, and System Verilog, sixth edition,
Pearson.
• Wayne Wolf, FPGA-Based System Design,
Prentice Hall.
Introduction to Digital Logic
• Digital systems.
• Number systems.
General way of representation
Number base conversion.
Octal and hexadecimal numbers.
Introduction to Digital Logic (Cont’d)
• Complement of a number.
• Signed binary number.
• Binary codes
• Binary logic
• Field Effect Transistors
Digital Systems
• Present age of technology is referred to as digital age.
• Digital systems are used in
• communication
• business transaction
• traffic control
• space craft guidance
• medical treatment
• weather monitoring and etc.
Other Digital Systems
• Special purpose digital computers .
• Used to represent and manipulate discrete elements of
information.
Digital Systems
• Discrete elements of information can be represented by group
of binary digits called binary codes.
• Either can be emerged from
– a processed data or
– quantized from continuous signals.
• Example
A general purpose digital computer that contains
– A memory unit
– A central processing unit
– I/O units.
Digital Systems (cont’d)
Most of commercial devices are made of digital circuits.
• They are programmable.
• Same type of hardware can be used for different
applications.
• Advances in Integrated Circuit technology.
• Performs at very high speed.
100 Millions of operations per second.
• Can operate with high reliability .
Error correction codes.
Number systems

• Different numbering systems

6738
Base

• Radix of
• Binary: 2 (0,1)
• Decimal: 10 (0,1,2,3,4,5,6,7,8,9)
• Octal: 8 (0,1,2,3,4,5,6,7)
• Hex: 16 (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)

Most Significant Bit Least Significant Bit


(MSB) (LSB)
Number Systems
• We can use different number systems (with different bases or
radixes) such as,
• 7392
• 26.75
• 1101012
• B65F16
• 673.1248
Number Systems (cont’d)
• We can use a general way of representation.
(anan-1an-2……a2a1a0.a-1a-2a-3…..a-m+1a-m )r
• Can be also represented in base 10,
an.rn + an-1.rn-1 + an-2.rn-2 + …… + a2.r2 + a1.r + a0.r0
+ a-1.r-1 + a-2.r-2 + a-3.r-3 + ….. + a-m+1.r-m+1 + a-m.r-m
Positional Numbering System
• Decimal Number system
• Binary Number system
• Octal Number system
• Hexadecimal Number system
 the maximum value of any digit in any number system is Base
– 1.
 Decimal number systems :- The maximum value of single
digit = base (10)-1 = 9. And the all 10 digits are 0, 1, 2,3, 4, 5,
6, 7, 8, 9.
• binary number 1101.011 Mathematically, we can write it as
1101.011 = (1 × 23) + (1 × 22) + (0 × 21) + (1 × 20) + (0 × 2-1) +(1
× 2-2) + (1 × 2-3)
Base conversion
• Exercise:
• Convert 11010012 to decimal
• Convert 0.10112 to decimal
• Convert 10101.1012 to decimal

• Exercise:
• Convert 11010012 to decimal
• Convert 0.10112 to decimal
• Convert 10101.1012 to decimal
Octal and Hexadecimal Number
Systems
• An octal digit corresponds to 3 binary digits.
• A hexadecimal digit corresponds to 4 binary digits.
• Binary to octal conversion.
10 110 001 101 011 . 111 100 000 1102 = 26153.74068
• Binary to hexadecimal conversion.
10 1100 0110 1011 . 1111 00102 = 2C6B.F216
Base Conversion of Number System.
Number systems can be represented in different radixes.
Exercise
1. Convert 2310 to binary.
2. Convert 32110 to octal.
3. Convert 0.687510 to binary.
4. Convert 0.687510 to octal.
5. Convert 41.687510 to binary and 153.51310 to octal.
6. Convert 673.1248, and 306.D16 to Binary.
Arithmetic Operations of Number
System.
Follows the same rules as decimal numbers.
• Example: If r =2,

Subtraction
Minuend 101101
Subtrahend 100111
Addition
Difference
Augend 101101
Multiplication
Addend 100111
Multiplicand 1011
Sum
Multiplier 101
Product
Complement of a Number
• Complements of a number are used to simplify Arithmetic
operation.
Example: Subtraction
• There are two types of complement of a number.
– r‘s complement or radix complement
– (r-1)’s complement or diminished radix complement
Radix Complement
• Defined as
− rn – N, for N ≠ 0 and
10 pow(n) -N
− 0, for N = 0.
− Where, N- given number, and n- no. of bits.
− r-radix

• 10’s complement of a number


- Obtained by leaving all least significant 0’s unchanged,
subtracting the first nonzero least significant digit from 10
and subtracting all higher significant digits from 9.
- 10’s complement of 246700 is 753300.
Radix Complement
• 2’s complement of a number.
- Obtained by leaving all least significant 0’s and the first 1
unchanged and replacing 1’s with 0’s and 0’s with 1’s in all
other higher significant digits.
- 2’s compliment of 0110111 is 1001001.

2 pow(n) -N
Diminished Radix Complement
• Defined as,
− (rn - 1) – N.
− Where, N – the Number.
• 9’s complement of 012398
(rn - 1) – N = 999999 – 012398 = 987601
• 1’s complement of a number
- Obtained by subtracting each digit from 1.
- 1’s complement of 0101101 is 1010010.

2 pow(n)-1 -N
Subtraction with Complement
Subtraction of two n-digit, unsigned numbers, M - N can be done
as,
1. Take r’s complement of subtrahend (N) and add with
minuend (M).
M + (rn - N) = M – N + rn .
a) If M ≥ N, the end carry (rn )can be discarded.
b) If M < N,
a) the result is rn – (N - M), which is r’s complement
of (N - M).
b) To obtain the answer, take r’s complement of the
sum, and place a negative sign in front of it.
Subtraction With Complements
(cont’d)
Exercise
• Using 10’s complement, subtract 3250 – 72532.
• Using 2’s complement, subtract 1010100 – 1000011 and
vice versa.
Signed Binary Numbers
Signed & Magnitude Conversion.
• Need to represent signed and unsigned numbers by a string of
bits in computers.
• If it is a signed number , then the leftmost bit may represent the
sign.
Signed Binary Numbers
Signed & Magnitude Conversion (cont’d)
• If it is an unsigned number, then the left most bit is the MSB of
the number.
• Example
11001 represents,
– 25, for unsigned representation.
– -9, for signed representation.
Signed Binary Numbers (cont’d)
Signed & Complement System
A different system called Signed & Complement System is also
widely used.
• The signed & complement system uses complement of a
number to negates it.
- Either 1’s complement or 2’s complement can be used.
- 2’s complement is most commonly used.
Example
• +9 is represented as,
00001001 (signed & magnitude)
• -9 is represented as,
• 10001001 (signed-magnitude)
• 11110110 (signed-1’s compliment)
• 11110111 (signed-2’s compliment)
Comparison between Different Signed
Binary Numbers
Decimal 2’s Complement 1’s Complement Signed &
(Signed) (signed) Magnitude
+4 0100 0100 0100
+3 0011 0011 0011
+2 0010 0010 0010
+1 0001 0001 0001
0 - 1111 1000
-1 1111 1110 1001
-2 1110 1101 1010
-3 1101 1100 1011
-4 1100 1011 1100
Arithmetic Addition
1. If there are any negative numbers (addend or augend) then
convert them into 2’s complement.
2. Add the two numbers, including sign-bit position.
3. Discard carry-out of the sign-bit position (if any).

Example

Negative results are already in 2’s complement.


Arithmetic Subtraction
1. If there any negative number (minuend, or subtrahend) then
convert them into 2’s complement.
2. Take 2’s complement of subtrahend and add with minuend.
3. Discard carry out of signed bit position (if any).
Example
Consider (-6) – (-13) = +7
– 2’s Complement of the negative numbers are (1111 1010) ,
and (1111 0011).
– 2’s complement of subtrahend (-13) is 0000 1101.
– Add to the minuend with 2’s complement of the subtrahend.
1111 1010 + 0000 1101 = 1 0000 0111
– Discard the carry out position.
Result is 00000111 (+7).
Binary Codes.
• Binary codes are used to represent a set of discrete elements
that is distinct among the set.
• An n-bit binary code has 2n distinct combinations of 1’s and 0’s.
Example: - Four- bit binary code is used to represent a set of
16 elements .
• Also a binary code may have some unassigned bit combinations.
Binary Coded
Decimal

• A binary code represents only 10 elements must contain at least


4-bits,
Six out of the 16 possible combinations remain unassigned.

• The code which uses the straight binary assignment is called


binary-coded decimal (BCD).
• BCD: Each group of 4 bits represents one decimal digit.
• e.g.: 18510 = 0001 1000 0101BCD = 101110012
• The binary combinations (1010 to 1111 ) are not used and having no meaning in BCD.
BCD Addition
Consider addition of two decimal digits in BCD.
• Needs to represent a carry when the sum exceeds
decimal 9.
• If the sum exceeds decimal 9, then needs to add decimal
6 (01102) to obtain the sum.
Example
Consider the addition of 184 + 576.
Other Binary Codes
Gray Code
• Mostly used in ADC systems.
• A most convenient binary code.
• When going from one number to the next, only one bit in the
code changes.
• Reduce error and ambiguity in hardware.
• Application,
Used to represent angular position of a mechanical-shaft.
Example
Error-Detecting Code
• Detects errors in data communication and data processing.
• A parity bit may be included with a message to make the total
numbers of 1’s either even or odd.
• The parity bit may be inserted in the left most position of the
number
• Example,
Binary Logic.
• Contains variables, which take two discrete values (1 or 0).
• Referred to as Boolean algebra.
• Binary logic.
– Consists of binary variables and a set of logical operations.
– There are three basic logical operations: AND, OR and NOT.
– Each operation produces a binary result.
Logic Gates
• Logic gates are electronic circuits.
• Operate with one or more input signals and produce an output
signal.
• The input terminal of digital circuits accepts binary signals within
an allowable range.
• Output signal falls within a specified range.
• The intermediate region is crossed only during a state transition.
State Transition
Example

Two input AND gate Two input OR gate NOT gate

Three input AND gate Four input OR gate


References
[1]. “Digital Design”, “Fifth edition”, M.Morris Mano, Michael D.
Ciletti.

You might also like