CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
Chapter 1 Digital Systems and Numbers System
CHAPTER 2 Number Systems, Operations, and Codes
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Number Systems and Arithmetic
EE 261 – Introduction to Logic Circuits
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Number Systems and Codes
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numbering systems.
Data Representation – Binary Numbers
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Digital Systems and Logic Design
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Chapter 3 Data Representation
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Number systems & Binary codes MODULE 1 Digital Logic Design Ch1-2 Outline of Chapter 1  1.1 Digital Systems  1.2 Binary Numbers  1.3 Number-base Conversions.
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
Number Systems and Codes
Chapter 1: Digital Computers and Information Illustration at beginning of each Chapter Base 10 Binary Base 2 Octal Base 8 Hex bas
Data Representation, Number Systems and Base Conversions
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
AEEE2031 Data Representation and Numbering Systems.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Logic Design: Part 1.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
N 3-1 Data Types  Binary information is stored in memory or processor registers  Registers contain either data or control information l Data are numbers.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Number Systems & Binary Arithmetic
Unit 1 Introduction Number Systems and Conversion.
Chapter 1 Digital Systems and Binary Numbers
Digital Design Chapter One Digital Systems and Binary Numbers
Number Systems and Codes
NUMBER SYSTEMS.
Lec 3: Data Representation
CS2100 Computer Organisation
Lecture No. 4 Number Systems
Number Systems and Binary Arithmetic
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Introduction to Chapter 2
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
Chapter 3 Data Representation
Number System conversions
Chapter 1 Digital Systems and Binary Numbers
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
University of Gujrat Department of Computer Science
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
INTRODUCTION TO LOGIC DESIGN Chapter 1 Digital Systems and Binary Numbers gürtaçyemişçioğlu.
Number Systems and Binary Arithmetic
Number Systems and Codes
Digital Electronics & Logic Design
Digital Logic & Design Lecture 03.
Numbering System TODAY AND TOMORROW 11th Edition
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Chapter Four Data Representation in Computers By Bezawit E.
CHAPTER 69 NUMBER SYSTEMS AND CODES
Presentation transcript:

CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC

Number & codes (1) Digital vs. Analog Numbering systems Octal (Base 8) Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16) Octal (Base 8) Number conversion Binary arithmetic 1’s and 2’s complements of binary numbers

Number & codes (2) Signed/Unsigned numbers Arithmetic operations with signed numbers Coded Binary-Coded-Decimal (BCD)/ 8421 ASCII Gray Excess-3) Error Detecting and Correction Codes Floating Point Numbers

Digital vs. Analog Two ways of representing the numerical values of quantities : i) Analog (continuous) ii) Digital (discrete) Analog : a quantity represented by voltage, current or meter movement that is proportional to the value that quantity. Digital : the quantities are represented not by proportional quantities but by symbols called digits (0/1).

Digital vs. Analog (cont.) Digital system: combination of devices designed to manipulate logical information or physical quantities that are represented in digital forms Analog system: contains devices manipulate physical quantities that are represented in analog forms

Digital vs. Analog (cont.) 1 Systems which process discrete (step by step) values Systems which are capable of processing a continuous range of values varying with respect to time 2 Digital representation the quantities - digits (0/1) Analog representation a quantity – I / V / meter movement 3 4 Example: Digital watch, PSP, iPod, Handphone, digital computers and calculators Example: audio amplifiers, magnetic tape recording and playback equipment

Digital vs. Analog (cont.) Why digital ? Problem with all signals – noise Noise isn't just something that you can hear - the fuzz that appears on old video recordings also qualifies as noise. In general, noise is any unwanted change to a signal that tends to corrupt it. Digital and analogue signals with added noise: Digital : easily be recognized even among all that noise : either 0 or 1 Analog : never get back a perfect copy of the original signal

Digital Techniques Advantages: Limitations: Easier to design Information storage is easy Accuracy and precision are greater Operation can be programmed - simple Digital circuits less affected by noise More digital circuitry can be fabricated on IC chips Limitations: In real world there are analog in nature and these quantities are often I/O that are being monitored, operated on, and controlled by a system. Thus, conversion and re-conversion in needed

Analog Waveform

Digital Waveform

Introduction to Numbering Systems We are familiar with decimal number systems for daily used such as calculator, calendar, phone or any common devices use this numbering system : Decimal = Base 10 Some other number systems: Binary = Base 2 Octal = Base 8 Hexadecimal = Base 16

Numbering Systems Decimal Binary Octal Hexadecimal 0 ~ 9 0 ~ 1 0 ~ 7 0 ~ 9, A ~ F

Numbering Systems (cont.) 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Binary Octal Hex Dec N U M B E R S Y T

Significant Digits Binary : 1 0 1 1 0 1 Most Significant Bit Least Significant Bit (MSB) (LSB) Hexadecimal: 1 D 6 3 A 7 Most Significant Digit Least significant Digit (MSD) (LSD)

Decimal numbering system (base 10) Base 10 system: (0,1,2,3,4,5,6,7,8,9) Example : 39710 3 9 7 Weights for whole numbers are positive power of ten that increase from right to left , beginning with 100 3 X 102 + 9 X 101 + 7 X 100 => 300 + 90 + 7 => 39710

Binary Number System (base 2) Base 2 system: (0 , 1) used to model the series of computer electrical signals represent the informations. 0 represents the no voltage or an ‘off’ state 1 represents the presence of voltage or an ‘on’ state Example: 1012 1 0 1 Weights in a binary number are based on power of two, that increase from right to right to left, beginning with 20 1X 22 + 0 X 21 + 1 X 20 => 4 + 0 + 1 => 510

Octal Number System (base 8) Base 8 system: (0,1,………,7) multiplication and division algorithms for conversion to and from base 10 example : 7568 convert to decimal 7 5 6 Weights in a binary number are based on power of eight that increase from right to right to left, beginning with 80 + 7X 82 5 X 81 + 6 X 80 => 448 + 40 + 6 49410 => Readily converts to binary Groups of three (binary) digits can be used to represent each octal number example : 7568 convert to binary 7 5 6 1111011102

Hexadecimal Number System (base 16) BINARY 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 A 10 1010 B 11 1011 C 12 1100 D 13 1101 E 14 1110 F 15 1111 Base 16 system Uses digits 0 ~ 9 & letters A,B,C,D,E,F Groups of four bits represent each base 16 digit

Hexadecimal Number System (2) Base 16 system multiplication and division algorithms for conversion to and from base 10 example : A9F16 convert to decimal A 9 F Weights in a hexadecimal number are based on power of sixteen that increase from right to right to left,beginning with 160 10X 162 + 9 X 161 + 15 X 160 => 2560 + 144 + 15 271910 => Readily converts to binary Groups of four (binary) digits can be used to represent each hexadecimal number example : A9F16 convert to binary A 9 F 1010100111112

Number Conversion Any Radix (base) to Decimal Conversion

Number Conversion (BASE 2 –> 10) Binary to Decimal Conversion

Binary to Decimal Conversion Convert (10101101)2 to its decimal equivalent: Binary 1 0 1 0 1 1 0 1 Positional Values x x x x x x x x 27 26 25 24 23 22 21 20 Products 128 + 0 + 32 + 0 + 8 + 4 + 0 + 1 = 17310

Octal to Decimal Conversion Convert 6538 to its decimal equivalent: Octal Digits 6 5 3 x x x Positional Values 82 81 80 Products 384 + 40 + 3 = 42710

Hexadecimal to Decimal Conversion Convert 3B4F16 to its decimal equivalent: Hex Digits 3 B 4 F x x x x Positional Values 163 162 161 160 Products 12288 + 2816 + 64 +15 = 15,18310

Number Conversion INTEGER DIGIT: Decimal to Any Radix (Base) Conversion INTEGER DIGIT: Repeated division by the radix & record the remainder FRACTIONAL DECIMAL: Multiply the number by the radix until the answer is in integer example : 25.3125 to Binary

Decimal to Binary Conversion Remainder 2 5 = 12 + 1 2 1 2 = 6 + 0 6 = 3 + 0 3 = 1 + 1 MSB LSB 1 = 0 + 1 2 2510 = 1 1 0 0 1 2

Decimal to Binary Conversion MSB LSB Carry . 0 1 0 1 0.3125 x 2 = 0.625 0 0.625 x 2 = 1.25 1 0.25 x 2 = 0.50 0 0.5 x 2 = 1.00 1 Answer: 1 1 0 0 1.0 1 0 1

Decimal to Octal Conversion Convert 42710 to its octal equivalent: 427 / 8 = 53 R3 Divided by 8; R is LSD 53 / 8 = 6 R5 Divide Q by 8; R is next digit 6 / 8 = 0 R6 Repeat until Q = 0 6538

Decimal to Hexadecimal Conversion Convert 83010 to its hexadecimal equivalent: 830 / 16 = 51 R 14 51 / 16 = 3 R3 3 / 16 = 0 R3 = E in Hex 33E16

Decimal to Octal Conversion Binary to Octal Conversion (vice versa) Grouping the binary position in groups of three starting at the least significant position.

Octal to Binary Conversion Each octal number converts to 3 binary digits To convert 6538 to binary, just substitute code: 6 5 3 110 101 011

Example : Number Conversion Convert the following binary numbers to their octal equivalent (vice versa). 1001.11112 47.38 1010011.110112 Answer: 11.748 100111.0112 123.668

Binary to Hexadecimal Conversion Binary to Hexadecimal Conversion (vice versa) Grouping the binary position in 4-bit groups, starting from the least significant position.

Binary to Hexadecimal Conversion The easiest method for converting binary to hexadecimal is using a substitution code Each hex number converts to 4 binary digits

Number Conversion Example: Convert the following binary numbers to their hexadecimal equivalent (vice versa). 10000.12 1F.C16 Answer: 10.816 00011111.11002

Substitution Code (1) = 56AE6A16 5 6 A E 6 A Convert (010101101010111001101010)2 to hex using the 4-bit substitution code : 0101 0110 1010 1110 0110 1010 5 6 A E 6 A = 56AE6A16

Substitution Code (2) Substitution code can also be used to convert binary to octal by using 3-bit groupings: 010 101 101 010 111 001 101 010 2 5 5 2 7 1 5 2 = 255271528

Binary Addition 0 + 0 = 0 Sum of 0 with a carry of 0 Example: 11001 111 + 1101 + 11 100110 ???

Application of counting in binary (pg 50-51 textbook)

Application of counting in binary (pg 50-51 textbook)

Binary Subtraction 0 - 0 = 0 1 - 1 = 0 1 - 0 = 1 10 -1 = 1 0 -1 with a borrow of 1 Example: 1011 101 - 111 - 11 100 ???

Simple Arithmetic Addition Example: 100011002 5816 + 1011102 + 2416 + 1011102 101 1 10102 Substraction 10001002 - 1011102 101102 Example: 5816 + 2416 7C16

Binary Multiplication 0 X 0 = 0 0 X 1 = 0 Example: 1 X 0 = 0 100110 1 X 1 = 1 X 101 100110 000000 + 100110 10111110

Binary Division Use the same procedure as decimal division

1’s complements of binary numbers Changing all the 1s to 0s and all the 0s to 1s Example: 1 1 0 1 0 0 1 0 1 Binary number 0 0 1 0 1 1 0 1 0 1’s complement ****** same as applying NOT gate ******

2’s complements of binary numbers Step 1: Find 1’s complement of the number Binary # 11000110 1’s complement 00111001 Step 2: Add 1 to the 1’s complement 00111001 + 1 00111010

Information about signed binary numbers (pg 62 textbook) A signed binary number consists of both sign and magnitude information The sign indicates whether a number is positive or negative The magnitude is the value of number There are 3 forms in which a sign number can be represented Sign magnitude (least used) 1’s complement 2’s complement (most important because computer use 2’s complement for negative number in arithmetic operation) F.Y.I->Non-integer and very large or very small number can be expressed in floating point form

Signed Magnitude Numbers 110010.. …00101110010101 Sign bit 31 bits for magnitude 0 = positive 1 = negative ***** This is your basic Integer format

Sign numbers Left most is the sign bit Sign-magnitude 0 is for positive, and 1 is for negative Sign-magnitude 0 0 0 1 1 0 0 1 = +25 sign bit magnitude bits 1 0 0 1 1 0 0 1 = -25 sign magnitude bits 1’s complement The negative number is the 1’s complement of the corresponding positive number Example: +25 is 00011001 -25 is 11100110

Sign numbers 2’s complement Example: +25 is 00011001 The negative number is the 2’s complement of the corresponding positive number. Thus, -25 in 2’s complement form is 11100111 Express +19 and -19 in i. sign magnitude ii. 1’s complement iii. 2’s complement

Arithmetic operation with signed numbers-Addition There are 4 cases that can occur when two signed binary numbers are added: Both numbers are positive e.g. 7+4 Positive number with magnitude larger than negative number e.g. 7 + (-4) Negative number with magnitude larger than positive number e.g. 4+(-7) Both numbers are negative e.g. (-4) +(-7)

Arithmetic operation with signed numbers-Subtraction Subtraction is a special case of addition (a) 8 +(-3) (b) 8-(-3) (c) -8-3 (d)-8-(-3)

Arithmetic operation with signed numbers-Multipication Multipication in most computers is accomplished using addition e.g. 8*3 = 8+8+8 In order to perform multiplication, can use either Direct addition method e.g. 8*3 Partial products method e.g. 8 *(-3) When two binary numbers are multiplied, both numbers MUST be in true(uncomplemented) form

Arithmetic operation with signed numbers-Division Division operation in computers is accomplished using subtraction. e.g. 21/7 (thus, need to subtract 7 from 21 for 3 times) Initialize quotient to zero Each partial remainder, add 1 to quotient

Digital Codes (1) BCD (Binary Coded Decimal) / 8421 Code Represent each of the 10 decimal digits (0~9) as a 4-bit binary code. Useful as keypad inputs, digital clocks, digital thermometer and other devices with 7-segment displays Example: Convert 15 to BCD. 1 5 0001 0101 Convert 10 to binary and BCD.

Digital Codes (2) ASCII (American Standard Code for Information Interchange) Code Used to translate from the keyboard characters to computer language A world standard alphanumeric code for microcomputers and computers A 7-bit code representing 27 (128) diff. characters (26 upper case, 26 lower case, 10 numbers, 33 special characters/symbol, 33 ctrl characters 8-bit version ASCII (USACC-II 8 or ASCII-8) represent max. of 256 characters.

Digital Codes (3) The Gray Code Only 1 bit changes Decimal Binary Gray Code 0000 1 0001 2 0010 0011 3 4 0100 0110 5 0101 0111 6 The Gray Code Only 1 bit changes Can’t be used in arithmetic circuits Used in shaft position encoders Can convert from Binary to Gray Code and vice versa. How to convert ?????

Digital Codes (4) Excess-3 Code Used to express decimal numbers. The code derives its name from the fact that each binary code is the corresponding 8421 code plus 3

Digital Codes (6) Error Detecting and Correction Code Required for reliable transmission and storage of digital data. Error Detecting Codes Parity (Even and Odd) Check sums=Cyclic Redundancy Check; to detect one and two-bit transmission error Error Correcting Codes Hamming Code ????

Digital Codes (7) EBCDIC (Extended Binary Coded Decimal Interchange) Code Mainly used with large computer systems like mainframe. An 8-bit code and accommodates up to 256 characters Divided into 2 portions: 4 zone bits (on the left) and 4 numeric bits (on the right)

Floating Point Numbers (FPN) A real number or FPN is a number which has both an integer and a fractional part. Examples: Real decimal numbers: 123.45, 0.1234, -0.12345 Real binary numbers: 1100.1100, 0.1001, -1.001 Generally, FPNs are expressed in exponential notation. Eg: 30000.0 can be written as 3 x 104 312.45 can be written as 3.1245 x 102 1010.001 can be written as 1.010001 x 103 mantissa exponent

Thank you!