Download presentation
Presentation is loading. Please wait.
Published byJob Bailey Modified over 8 years ago
1
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: 0249990362. LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
2
Course Reference Materials 1.Digital Fundamentals with PLD Programming by Thomas L. FLOYD. 2.Logic and Computer Design Fundamentals, 2 nd Edition. by M. Morris MANO and Charles R. KIME. 3.Fundamentals of Digital Logic With VHDL Design. by Stephen BROWN and Zvonko VRANESIC. 4. Fundamentals of Logic Design, 5 th Edition by Charles H. ROTH, Jr.
3
COURSE OUTLINE INTRODUCTION TO DIGITAL LOGIC SYSTEMS NUMBER SYSTEM AND CONVERSION BINARY TO DECIMAL DECIMAL TO BINARY BINARY ARITHMETIC REPRESENTATION OF NEGATIVE NUMBERS BINARY CODES BOOLEAN ALGEBRA APPLICATION OF BOOLEAN ALGEBRA KARNAUGH MAPS
4
COURSE OUTLINE QUINE – McCLUSKEY METHOD COMBINATIONAL CIRCUIT DESIGN AND SIMULATION USING GATES MULTIPLEXERS, DECODERS SEQUENTIAL LOGIC DESIGN MINI PROJECT
5
CHAPTER ONE NUMBER SYSTEM AND CONVERSION Digital systems are used extensively in computation and data processing, control systems, communications, and measurement. REASONS 1. Digital systems are capable of greater accuracy than analog systems 2. Reliability is greater than analog. 3. More data can be stored in storage device when digitized than when they are not. INTRODUCTION
6
Design of Digital Systems Digital System Design is in three parts - System Design - Logic Design - Circuit Design
7
Design of Digital Systems SYSTEM DESIGN: Breaking the overall system into subsystems and specifying the characteristics of each subsystem. LOGIC DESIGN: Determining how to interconnect basic logic building blocks to perform a specific function. CIRCUIT DESIGN: Specifying the interconnection of specific components such as resistors, diodes, and transistors to form a gate, flip – flop, or other logic building block.
8
Switching Circuits A switching circuit has one or more inputs and one or more outputs which take on discrete values. In this course we shall study two types of switching circuits – combinational and sequential.
9
Switching Circuits Combinational Circuit:The output values depend only on the present value of the inputs and not on the past values. Sequential Circuit: The outputs depend on both the present and past input values.
10
A block Diagram of a Switching Circuit Switching Circuit Outputs Inputs Z1Z1 ZnZn Z1Z1 X1X1 X2X2 XnXn :. :.
11
Number System and Conversion The decimal (base 10) numbers are called positional numbers, each position is assigned a weight. For example, 935.87 10 = 9 X 10 2 + 3 X 10 1 + 5 X 10 0 + 8 X10 -1 + 7 X 10 -2. 1101.10 2 = 1 X 2 3 + 1 X 2 2 + 0 X 2 1 + 1 X 2 0 + 1 X 2 -1 + 0 X 2 -2 = 8 + 4 + 0 + 1 + ½ + 0 = 13.5 10.
12
Number Conversion Any positive integer R (R > 1) can be chosen as the radix or base of a number system. If the base is R, then R digits (0, 1,..., R – 1) are used.
13
Number Conversion A number written in positional notation can be expanded in power series in R. For example, N = (a 4 a 3 a 2 a 1 a 0.a -1 a -2 a -3 ) R = a 4 X R 4 + a 3 X R 3 + a 2 X R 2 + a 1 X R 1 + a 0 X R 0 + a -1 X R -1 + a -2 X R -2 + a -3 X R -3 Where a i is the coefficient of R i and 0≤ a i ≥ R-1.
14
For bases greater than 10, more than 10 symbols are needed to represent the digits. For example, In hexadecimal (base 16), A represents 10 10, B represents 11 10, C represents 12 10, D represents 13 10, E represents 14 10, and F represents 15 10. Thus; A3F 16 = 10 X 16 2 + 3 X 16 1 + 15 X 16 0 = 2560 + 48 + 15 =2623 10. Number Conversion
15
NUMBER CONVERSION TYPES Binary – to - decimal conversion Decimal - to - binary conversion -Repeated division – by – R method. (R = Radix or Base) -Sum – of – weights method.
16
The base R equivalent of a decimal integer N can be represented as: N = (a n a n-1...a 2 a 1 a 0 ) = a n R n + a n-1 R n-1 +...+ a 2 R 2 + a 1 R 1 + a 0. If we divide N by R, the remainder is a 0 : N/R = a n R n-1 + a n-1 R n-2 +...+ a 2 R 1 + a 1 = Q 1, remainder a 0 REPEATED DIVISION - BY - R METHOD
17
Then we divide the quotient Q 1 by R: Q 1 /R = a n R n-2 + a n-1 R n-3 +...+ a 3 R 1 + a 2 = Q 2, remainder a 1 This process is continued until we finally obtain a n. Note that the remainder obtained at each division step is one of the desired digits and the least significant digit (LSB) is obtained first. REPEATED DIVISION - BY - R METHOD
18
SUM – OF – WEIGHT METHOD Determine the set of binary weights whose sum is equal to the decimal number. The lowest weight is 1, which is 2 0. Doubling any weight, you get the next higher weight. Example: 9 = 8 + 1 or 9 = 2 3 + 2 0 Thus 9 = 1001
19
Conversion Decimal Fractions to Binary There are two ways of converting Decimal fractions to Binary Sum – of – weight method Repeated Multiplication by R Method (where R is the Radix or Base).
20
Sum – of – Weight Method The most significant weight is 0.5, which is 2 -1 Halving any weight, get you next lower weight. Example 0.5, 0.25, 0.125, 0.0625. 0.625 = 0.5 + 0.125 = 2 -1 + 2 -3 = 0.101. There is a 1 in the 2 -1 position, a 0 in the 2 -2 position, and a 1 in the 2 -3 position.
21
REPEATED MULTIPLICATION BY R METHOD Conversion of a decimal fraction to base R can be done using successive multiplications by R. A decimal fraction F can be represented as F = (.a -1 a -2 a -3...a -m ) R = a -1 R -1 + a -2 R -2 + a -3 R -3 +... +a -m R -m Multiplying by R yields FR = a -1 + a -2 R -1 + a -3 R -3 +... + a -m R -m+1 = a -1 + F 1
22
Where F 1 represents the fractional part of the result and a -1 is the integer part. Multiplying F 1 by R yields F 1 R = a -2 + a -3 R -1 +... + a -m R -m+2 = a -2 + F 2 This process is continued until we have obtained a sufficient number of digits Note that the integer part obtained at each step is one of the desired digits and the most significant digit (MSB) is obtained first. REPEATED MULTIPLICATION BY R METHOD
23
Example: Convert 0.625 10 to binary. F = 0.625 X 2 = 1.250 (a -1 = 1), F 1 =.250 X 2 = 0.500 (a -2 = 0), F 2 =0.500 X 2 = 1.000 (a -3 = 1). 0.625 10 =.101 2.
24
BINARY ARITHMETIC Arithmetic operations in digital systems are usually done in binary because design of logic circuits to perform binary arithmetic is much easier than for decimal. Binary arithmetic operations: Addition Multiplication Subtraction Division
25
The addition table for binary numbers is 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 and carry 1 to the next column. Carrying 1 to a column is equivalent to adding 1 to that column. BINARY ADDITION
26
Add 13 10 and 11 10 in binary. 1111 13 10 = 1101 11 10 = 1011 11000 = 24 10 carries BINARY ADDITION
27
BINARY SUBTRACTION The subtraction table for binary number is 0 – 0 = 0 0 – 1 = 1 and borrow 1 from next column 1 – 0 = 1 1 – 1 – 0 Borrowing 1 from a column is equivalent to subtracting 1 from that column.
28
BINARY SUBTRACTION Example of binary subtraction 1 11101 - 10011 1010 A borrow from 3 rd position
29
BINARY SUBTRACTION Exercise 1. 10000 - 11 2. 111001 - 1011
30
BINARY MULTIPLICATION The multiplication table for binary numbers is 0 X 0 =0 0 X 1 = 0 1 X 0 = 0 1 X 1 = 1 Exercise Find 13 10 X 14 10 in binary.
31
Binary Multiplication Example (2): Find 101 X 111 101 111 000 111 100011 X
32
BINARY DIVISION ASSIGNMENT (1) Read on binary division
33
Representation of Signed Numbers In most computers, in order to represent both positive and negative numbers the first bit in a word is used as a sign bit, with 0 used for plus and 1 used for minus. For an n – bit word, the first bit is the sign and the remaining n -1 bits represent the magnitude of the number. Thus an n – bit word can represent any one of 2 n-1 positive integers or 2 n-1 negative integers.
34
The 1’s complement and 2’s complement The 1’s complement and 2’s complement are commonly used because arithmetic units are easy to design using these systems
35
Finding the 1’s complement For the 1’s complement system a negative number, -N, is represented by its 1’s complement, N. The 1’s complement of a positive integer N is defined as N = (2 n – 1) – N An alternative way of finding the 1’s complement is to simply complement N bit – by – bit by replacing 0’s with 1’s and 1’s with 0’s.
36
Finding the 2’s complement For the 2’s complement number system, a positive number, N, is represented by a 0 followed by the magnitude as in the sign and magnitude system; however, a negative number, -N, is represented by its 2’s complement, Ѝ.
37
Finding the 2’s complement = 2 n – N Note that N = (2 n – 1) – N. This implies = 2 n – N = (2 n – 1 – N) + 1 = N + 1 Another way of finding the 2’s complement of a binary number is as follows: Start at the right with the LSB and write the bits as they are up to and including the first 1. Take the 1’s complement of the remaining bits.
38
Back to True Binary Form To convert from 1’s complement back to the true binary, reverse all the bits. To go from 2’s complement form back to true binary, take the 1’s complement of the 2’s complement number and add 1 to the least significant bit.
39
ARITHMETIC OPERATION WITH SIGNED NUMBERS Addition of Signed Numbers The two numbers in an addition are the addend and augend. The result is the sum. There are four cases that can occur when two signed binary numbers are added.
40
Four Cases of Signed Binary Addition Both numbers positive Positive number with magnitude larger than negative number Negative number with magnitude larger than positive number Both numbers negative.
41
Both Numbers Positive 00000111 7 00000100 4 00001011 11 The sum is positive and is therefore in true (uncomplemented) binary. +
42
Positive number magnitude larger than negative number: 0000111115 11111010 6 1 00001001 9 The final carry bit is discarded. The sum is positive and therefore in true (uncomplemented) binary. +
43
Negative number with magnitude larger than positive number 0001000015 1110100024 11111000 8 The sum is negative and therefore in 2’s complement form. + - -
44
Both numbers negative 11111011-5 11110111-9 1 11110010 14 The final carry bit is discarded. The sum is negative and therefore in 2’s complement form. + + +
45
Over flow: When two numbers are added and the number of bits required to represent the sum exceeds the number of bits in the two numbers, an overflow results as indicated by an incorrect sign bit. An overflow occurs only when both numbers are negative or both numbers are positive. Example: 01111101125 00111010 58 10110111 183 In this example the sum of 183 requires eight magnitude bits. Since there are seven magnitude bits in the numbers (one bit is the sign bit), there is a carry into the sign bit which produces the overflow indication.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.