Digital Systems and Computer Architecture (RV University)
Document Details
Uploaded by QualifiedCedar7568
RV University
false
null
Tags
Summary
This document provides lecture notes on digital systems and computer architecture, focusing on fundamental concepts including binary codes, logic gates, and their applications. The lecture materials originate from RV University, and are in a PDF format.
Full Transcript
DIGITAL SYSTEMS AND COMPUTER ARCHITECTURE Module 2: Digital Logics And Binary Systems Session 2.1: Focus Analog Vs Digital Processing by Digital systems Number systems Binary, octal, hexadecimal Conversions from one to the other Binary codes and their cl...
DIGITAL SYSTEMS AND COMPUTER ARCHITECTURE Module 2: Digital Logics And Binary Systems Session 2.1: Focus Analog Vs Digital Processing by Digital systems Number systems Binary, octal, hexadecimal Conversions from one to the other Binary codes and their classifications Weighted codes Binary Coded Decimal (BCD) Non-weighted codes Gray code Optical Encoder Example using Gray Code ASCII codes Analog Vs Digital Real world Systems and Processes Real-world systems are mostly continuous (Analog) Time, acceleration, chemical reactions, etc. Mathematics to represent physical systems is continuous Calculus Sometimes discrete (Digital) No. of students in a class, items in a box, etc Mathematics can be discrete for Number theory Counting Approximating physical systems Analog Vs Digital Signals An analog signal is a continuous wave May vary in signal strength (amplitude) or frequency (time) A sine wave Any arbitrary signals can be represented using sine waves A digital signal is described using Binary (0s and 1s) Therefore, cannot take on other fractional values Amplitude Amplitude Time Time Quiz 1: Analog or Digital Systems? Record players Analog Digital (stored data is Compact disc (CD) players in Digital) Analog Cassette tape (stored voice is analog) Analog Mercury thermometers Quiz 1: Analog or Digital Systems? Car Speedometer Analog Analog Stethoscope Digital Video Disc (DVD) players Digital Digital Computers Why binary in computers? Computers use binary numbers because they have circuits which can either be in ON or OFF states That gives them only two states to work from To make calculations, To process data, etc. The two-digit, or base 2, number system is much easier for the computers to process With the circuits they are built with Processing by Digital Systems How does Computer process data? Computers need digital data which they can understand and process. They output processed digital data out. Input Digital Output Digital Data Data Analog to Digital Conversion In the real world, most data is characterized by analog signals To manipulate the data using a microprocessor Analog signals need to be converted to digital signals, before feeding them into computers for further processing Values Analog Signal Digital Signal Decimal Number Systems Decimal Number (base 10) The decimal number 3586.265 has two parts Integer part : 3586 Fractional part : 265 Represented in the base 10 format Integer Part: Fractional Part: Decimal To Binary, Octal and Hexadecimal Binary Weights 16 Decimal to Binary(base 2) Conversion Convert the decimal number 9.312510 to Binary Binary is represented in the base 2 format It means that there can only be 2 literals : 0 and 1 Integer Part: 9 = Fractional Part: 3125 = 0 + 0.25 + 0 + 0.0625 = 3125 9.312510 = 1001.01012 Decimal to Binary(base 2) Conversion Repeated Division Convert the decimal number 13.37510 to Binary Integer Part: 13 Fractional Part: 375 13.37510 = 1101.0112. Decimal to Octal: Procedure Convert the decimal number 73.7510 to Octal Integer Part: 73 Fractional Part: 75 73.7510 = 111.68 Decimal to Hexadecimal: Procedure Convert the decimal number 82.2510 to Hexadecimal Integer Part: 82 Fractional Part: 25 82.2510 = 52.416 Binary, Octal and Hex Table Decimal Binary Octal Hexadecimal Binary, Octal and Hex … the same slide Decimal Binary Octal Hexadecimal Decimal To Binary and Binary to Octal Octal to Binary: Procedure Convert the Octal number 374.268 to Binary Binary equivalent, in a group of three bits Can be expressed as: Omit the leftmost zeros of the integer part and the rightmost zeros of fractional part The result: 374.268 = 11111100.010112 Binary to Octal : Procedure Convert the binary 1110100.01001112 to Octal Group the bits into three starting from the decimal point on both directions Express it in a group of three binary digits: Add both leading and trailing zeros if needed 1110100.01001112 = 164.2348 Hex to Binary : Procedure Convert the Hex number 2F.C416 to Binary Binary equivalent, in a group of four bits Can be expressed as: Omit the leftmost zeros of the integer part and the rightmost zeros of fractional part The result: 2F.C416 = 101111.1100012 Binary to Hex: Procedure Convert the binary 1011001110.0110111012 to Hex Group the bits into four starting from the decimal point on both directions 1011001110.0110111012 = 2CE.6E816 Hex to Octal : Procedure Convert the Hex number 2F.C416 to Octal Write the Binary equivalent, in a group of four bits Group them into three bits starting from the decimal point on both directions: The result: 2F.C416 = 57.618 Octal to Hex : Procedure Convert the Octal 762.0138 to Hex Write the binary equivalent in a group of three bits, starting from the decimal point on both directions After combining the bits: Re-group them into four bits: 762.0138 = 1F2.05816 Binary Codes What are Binary Codes and Why are they needed? Digital systems represent and manipulate not only binary numbers, but also Many other discrete elements of information. Example: Digital speech signal, Character symbols (a, b, etc.) Any discrete element of information that is distinct among a group of quantities can be represented With binary code, i.e., a pattern of 0’s and 1’s The digital data is represented, stored and transmitted as group of binary bits A set of eight elements requires a three‐bit code and a set of 16 elements requires a four‐bit code Binary Codes Both letters, numbers, symbols are represented by binary codes Various fonts used in word processors are examples of binary codes Binary codes are used in computer applications and digital data communication Binary codes ease implementation of digital circuits to process encoded digital data Classification of Binary Codes Weighted Codes Non-Weighted Codes Binary Coded Decimal Code Alphanumeric Codes Error Detecting Codes – Not covered in this course Error Correcting Codes – Not covered in this course Weighted Codes Binary Coded Decimal (BCD) Weighted Codes Weighted binary codes are those binary codes which obey the positional weight principle. Each position of the number represents a specific weight. Several systems of the codes are used to express the decimal digits 0 through 9. In these codes each decimal digit is represented by a group of four bits Courtesy: Tutorial Point Binary Coded Decimal (BCD) Only the first 9 combinations of four bits are valid The remaining 6 combinations are unused in BCD Easier to represent decimal digits in BCD which is straightforward Example: (12.75)10 BCD (8421): (0001 0010.0111 0101)8421 (0001 0010.1101 1011)2421 Other BCDs Non-Weighted Codes: Gray Codes Constructing Gray Codes Value Gray code Gray code Gray code Gray code Gray Codes Gray Codes It is non-weighted code and it is not arithmetic code. i.e., Gray code cannot be used for arithmetic operations There are no specific weights assigned to the bit positions in Gray codes It has a very special feature that, only one bit will change each time the decimal number is incremented As only one bit changes at a time, the gray code is called as a unit distance code The gray code is a cyclic code. Circular shifts of each codeword gives another word that belongs to the code Use of Gray Codes It is a non-weighted code which belongs to a class of codes called minimum change codes Here, two adjacent code numbers differs from each other by only one bit Gray code is popularly used in the shaft position encoders. A shaft position encoder produces a code word which represents the angular position of the shaft It is also used in the transmission of digital signals The Gray code is used for labelling the axes of Karnaugh maps Optical Encoder Coded Disc Connected to a Rotating Shaft Alphanumeric Codes (ASCII) ASCII ASCII: American Standard Code for Information Interchange ASCII Codes The alphanumeric codes are the codes that represent numbers and alphabetic characters ASCII is a 7-bit code Extended Binary Coded Decimal Interchange Code (EBCDIC), is an 8-bit code With the limited support that an 8 bit code can provide to all the languages in the world, Unicode is defined in 1987 Unicode (UTF-16 and UTF-32) are 16 bit and 32 bits later versions, used for supporting various languages ASCII Codes The alphanumeric codes are the codes that represent numbers and alphabetic characters ASCII is a 7-bit code Extended Binary Coded Decimal Interchange Code (EBCDIC), is an 8-bit code With the limited support that an 8 bit code can provide to all the languages in the world, Unicode is defined in 1987 Unicode (UTF-16 and UTF-32) are 16 bit and 32 bits later versions, used for supporting various languages Session 2.1: Summary Analog Vs Digital Processing by Digital systems Number systems Binary, octal, hexadecimal Conversions from one to the other Binary codes and their classifications Weighted codes Binary Coded Decimal (BCD) Non-weighted codes Gray code Optical Encoder Example using Gray Code ASCII codes Session 2.2 : Logic Gates and Binary Adders and Subtractors Session 2.2: Focus Logic Gates AND, OR, NOT NAND and NOR XOR and Exclusive-NOR Logic Gates - ICs Binary Addition Half and Full Adder Circuits Binary Subtraction Half and Full Subtractor Circuits Parity Generators 7-Segment Display Logic Signals And Gates The logic signals (0 and 1) with which logic gates are driven are shown here The voltage levels have consistently come down due to low power requirements from 3V to less than 1V AND, OR, NOT Gates Quiz 1: Draw the Output signals Inputs to the gates x AND y Outputs of x OR y the gates NOT x Quiz 2: Give Truth Table Answer for (a): A B C F Answer for (b): 0 0 0 0 If any one input is 1, 0 0 1 0 the output (G) will be one 0 1 0 0 1 1 0 G is zero only when all 1 0 0 0 A, B, C, D are zeros 1 0 1 0 1 1 0 0 1 1 1 0 1 Quiz 3: Draw the Output waveform Output Answer: Output Quiz 4: What are the Outputs? Answers: Output Always One Output Always Zero NAND Gates Can also be written as: Y = AB NAND Gate with more than two inputs: ) NOR Gates 3-input NOR Gate : ) XOR Gate XOR Operator Truth Table of XOR Gate: XOR Gates XOR gate is sometimes referred to as “anything but not all” XOR gate is enabled only when there are odd number of digital 1s Therefore, an XOR gate can be viewed as an odd bits check circuit Multiple input XOR Gates A B Y= D C D 1. Output is 1 when only when either there are one or three 1s as inputs 2. Output is one when there are odd 1s as inputs Exclusive-NOR Gates 3-input Exclusive-NOR Gate : Q= Q This is an Even function. Output is 1 when there are even number of 1s as inputs Logic Gates ICs 74LS Series ICs Pin Numbers LS: Low-power Schottky family Some 74LS Series ICs 74 74 74 74 Binary Addition Basic Rules of Binary Addition (Half Adder) A + B = Sum (S) Carry is zero 3-bit Binary Addition (Full Adder) Larger-bit Binary Addition Consider 32 bit adders are used to add two 128 bit numbers Note: Consider each of them are 32- bit numbers Binary Subtraction Basic Rules of Binary Subtraction (Half Subtractor) A B (A-B) Di Bo A’B Binary Subtraction : Borrow Bit When 1 is subtracted from 0 A borrow is taken from the next most significant bit, by making it zero Subtraction Example A 37 --B D Overall, the result will the Borrow bit will be cleared (zero). Subtraction : Digital Implementation 37 --B DD Bin Di Ai Bo Bi HS 3-bit Binary Subtraction (Full Subtractor) Bin Do Bo Subtraction Example Borrow (in) and Borrow (out) are shown above Parity Generators Parity A parity bit, or check bit, is a bit added to a string of binary code that indicates whether the number of 1-bits in the string is even or odd Even parity: ◦ The number of 1-bits (including the parity bit) must add up to an even number Odd parity: ◦ The number of 1-bits (including the parity bit) must add up to an odd number What are even and odd Parities? Even parity bit is set when the number of 1s in the input string is even. Odd parity bit is set when the number of 1s in the input string is odd. Quiz 5:Which parity gets generated in the circuits below? Even parity Odd parity 7-Segment Display Code Number displayed is 3 here 1 means the segment is ON Session 2.2: Summary Parity bit 7-Segment Display Logic Gates AND, OR, NOT NAND and NOR XOR and Exclusive-NOR Logic Gates - ICs Binary Addition Half and Full Adder Circuits Binary Subtraction Half and Full Subtractor Circuits Parity Generators using XOR gates