CPS-304 DIGITAL LOGIC & DESIGN Instructor : Ms. Saba Iqbal
Textbook – Digital Design by Morris Mano, 2 nd Edition/ 3rd Edition/Digital Fundamentals.
Introduction to concepts of digital logic, gates, and the digital circuits Design and analysis of combinational and sequential circuits Basics of logic design of computer hardware What’s Course About?
Binary Systems Binary Algebra Simplification of Boolean Functions Combinational Logic Sequential Logic MSI Sequential Circuits Course Outline
Digital Computer follow a sequence of instructions, Digital System play a prominent role in this digital age – Communication, medical treatment, internet, DVD, CD, Space,Programme.Scientific &Educational field,ATC commercial etc. – called programs, that operate on given data – User can specify and change program or data according to needs Like Digital Computers, most digital devices are programmable Digital Systems have the ability to Manipulate discrete elements of information. – Any set that is restricted to a finite number of elements contains discrete information 10 Decimal digits 26 Alphabet letters 52 Playing cards 64 squares of a chessboard Digital Systems
Digital Systems can do hundreds of millions of operations per second Extreme reliability due to error-correcting codes A Digital System is interconnection of digital modules To understand Digital module, we need to know about digital circuits and their logical functions Hardware Description Language (HDL) is a programming language that is suitable for describing digital circuit in a textual form – Simulate a digital system to verify operation before it is built Digital Systems
7 COMPUTER Analog Computer,. It responds to continuous signals. Digital computer. It responds to 0 and 1. also called Binary. Main Modules. Memory Unit Processor Unit Control Unit Input Device / Output Device CPU Processor combined with Control Unit Micro Processor. CPU in a Small integrated circuit CPU combined with Memory and Interface control for i/p and o/p devices form a micro computer.
Fetch Time. Getting data and instructions from ALU and then issue command Fix time Execute Time. ALU carries out execution Time is variable Master clock. It is in control unit and control all functions Memory – RAM Semi conductor memory & Ferrite core memory – Sequential Memory. Mag tape, mag disk, CD Floppy Mag Drum. each info has a location and an address. 8 DATA FLOW
– Random Access Memory,. Access time to a location is constant. – Sequential access memory. Access time to all locations are different – Main memory and Secondary memory. How we store Semi conductor Magnetic Material Binary Req. as material can store only 1 and 0 – Three things are stored, Instructions, Data, Address. 9 DEFINATIONS MEMORY
7,392= 7x x x x10 0 – Thousands, hundreds, etc…power of 10 implied by position of coefficient Generally a decimal number is represented by a series of coefficients – a 6 a 5 a 4 a 3 a 2 a 1 a 0. a -1 a -2 a -3 a -4 a j cofficient are any of the 10 digit (0,1,2…9) Decimal number are base 10 Decimal Number
Digital Systems manipulate discrete quantities of information in binary form – Operands in calculations – Decimal Digits – Results Strings of binary digits (“bits”) Two possible values 0 and 1 Binary Number
Each digit represents a power of 2 Coefficient have two possible values 0 and 1 Strings of binary digits (“bits”) – n bits can store numbers from 0 to 2 n -1 – n bits can store 2 n distinct combinations of 1’s and 0’s Each coefficient a j is multiplied by 2 j So 101 binary is 1 x x x 2 0 or 1 x x x 1 = 5 Binary Numbers
A bit (short for binary digit) is the smallest unit of data in a computer. – A bit can hold only one of two values: 0 or 1, corresponding to the electrical values of off or on, respectively. – Because bits are so small, you rarely work with information one bit at a time – A byte is a unit of measure for digital information. – A single byte contains eight consecutive bits Binary Arithmetic. Addition, Subtraction Multiplication Give example BITs & Bytes
GATES
Octal Octal is base 8 A number is represented by a series of coefficients – a 6 a 5 a 4 a 3 a 2 a 1 a 0. a -1 a -2 a -3 a -4 a j cofficient are any of 8 digit (0,1,2…7) Need 3 bits for representation Example: (127.4) 8 = 1 X X X X = (87.5) 10 DecBinOctal
Hexadecimal Hexadecimal is base 16 A number is represented by a series of coefficients – a 6 a 5 a 4 a 3 a 2 a 1 a 0. a -1 a -2 a -3 a -4 a j cofficient are any of 16 digit (0,1,2,3,4,5,6,7,8, 9,A,B,C,D,E,F) Need 4 bits for representation (B65F) X X X X 16 0 = 11x x256 +5x = = 46,687 DecBinHex a b c d e f
Easy, just multiply digit by power of 2 Just like a decimal number is represented Example follows Converting Binary to Decimal
Binary Decimal Example = 156 What is in decimal?
A little more work than binary to decimal Some examples – 3 = = 11 (that’s ) – 5 = = 101 (that’s ) Decimal to Binary
1.Find largest power-of-two smaller than decimal number 2.Make the appropriate binary digit a ‘1’ 3.Subtract the power of 2 from decimal 4.Do the same thing again Algorithm – Decimal to Binary
Convert 28 decimal to binary Decimal Binary Example is too large, so use 16 Binary 10000Decimal 28 – 16 = 12 Binary 11000Decimal 12 – 8 = 4 Next is 8 Binary 11100Decimal 4 – 4 = 0 Next is 4
Convert decimal to binary IntegerFractionCoefficient X 2= a -1 = X 2= a -2 = X 2= a -3 = X 2= a -4 =1 (0.6875) 10 = (0.1011) 2 Decimal Binary (Fraction)
Similar to decimal binary. 1.Find largest power-of-8 smaller than decimal number 2.Divide by power-of-8. The integer result is Octal digit. 3.The remainder is new decimal number. 4.Do the same thing again Decimal to Octal
Convert decimal 153 to Octal Decimal Octal is too large, so use 64 Octal 200Decimal 153 – 64X2 = 25 Octal 230 Decimal 25 – 8X3= 1 Next is 8 Octal 231 Decimal 1 – 1X1 = 0 Next is 1
Convert decimal to Octal IntegerFractionCoefficient X 8 = a -1 = X 8 = a -2 = X 8 = a -3 = X 8 = a -4 = X 8 = a -5 = X 8 = a -5 =7 (0.513) 10 = ( ) 8 Decimal Octal (Fraction)
Partition Binary number into group of three digits each The corresponding octal digit is then assigned to each group ( ) 2 ( ) 2 = ( ) 8 Binary to Octal
Each Octal digit is converted to its three digit binary equivalent ( ) 8 = ( ) 2 Octal to Binary
Convention – write 0x before number Hex to Binary – just convert digits Hex to Binary BinHex a 1011b 1100c 1101d 1110e 1111f 0x2ac x2ac = No magic – remember hex digit = 4 bits
Just convert groups of 4 bits Binary to Hex BinHex a 1011b 1100c 1101d 1110e 1111f b = 0x537b 0101 0111 0011
Just multiply each hex digit by decimal value, and add the results. Hex to Decimal x2ac = 684 DecHex a 11b 12c 13d 14e 15f
Similar to decimal binary. 1.Find largest power-of-16 smaller than decimal number 2.Divide by power-of-16. The integer result is hex digit. 3.The remainder is new decimal number. 4.Do the same thing again Decimal to Hex
DecHex a 11b 12c 13d 14e 15f /256 = 2 0x2__ 684%256 = /16 = 10 = a 0x2a_ 172%16 = 12 = c 0x2ac