School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor 019-3806067 1 DKT 122/3 - DIGITAL SYSTEM I Chapter.

Slides:



Advertisements
Similar presentations
CHAPTER 1 : INTRODUCTION
Advertisements

Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
Number Systems & Operations
Chapter 2 : Number System
CHAPTER 2 Number Systems, Operations, and Codes
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
Number Systems and Arithmetic
© Copyright 2000 Indiana University Board of Trustees Proficiency Quiz Study Guide Note: The following slides are provided courtesy of Dr. Bob Orr (Computer.
Binary Numbers.
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
1.6 Signed Binary Numbers.
Number Systems and Codes
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Digital Electronics. Digital circuits work on the basis of a transistor being used as a switch. Consider a light switch, a transistor can be considered.
Chapter 3 Data Representation
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
Number systems, Operations, and Codes
Positional Notation 642 in base 10 positional notation is:
1 IT 231, CMPE 331 Digital Logic Design Week 2 Number systems and arithmetic.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
Introduction To Number Systems Binary System M. AL-Towaileb1.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
©2010 Cengage Learning SLIDES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION Click the mouse to move to the next page. Use the ESC key to exit.
Integer Operations Computer Organization and Assembly Language: Module 5.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
Number Systems and Binary Arithmetic Quantitative Analysis II Professor Bob Orr.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
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.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
Some basic concepts underlying computer archi­tecture
Digital Design Chapter One Digital Systems and Binary Numbers
Numbering Systems.
Number Systems and Binary Arithmetic
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
Digital Electronics Number Systems and Codes
CSE 102 Introduction to Computer Engineering
Chapter 3 Data Representation
Number System conversions
Number Systems.
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Number Systems and Binary Arithmetic
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Numbering System TODAY AND TOMORROW 11th Edition
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Digital Electronics and Microprocessors
Number Systems Rayat Shikshan Sanstha’s
Binary to Decimal Conversion
Presentation transcript:

School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter 2b: Number Systems Operation and Codeds

School of Computer and Communication Engineering, UniMAP 2 SIGN-MAGNITUDE: Decimal values of +ve & -ve no are determined summing the weights in all the mag. bit positions where there are 1’s and ignoring those positions where there are zeros. The sign is determined by examination Of the sign bit DECIMAL VALUE OF SIGNED NUMBERS

School of Computer and Communication Engineering, UniMAP 3 DECIMAL VALUE OF SIGNED NUMBERS Sign Magnitude - Determine the decimal value of this signed binary number expressed in sign-magnitude summing the weight where there is 1s = 21 The sign bit is 1; dec no is -21

School of Computer and Communication Engineering, UniMAP 4 DECIMAL VALUE OF SIGNED NUMBERS 1’s COMPLEMENT: Decimal values of +ve no are determined by summing the weights in all bit positions where there are 1s and ignoring those positions where there are zeros. Decimal number of –ve no are determined by assigning a –ve value to the weight of sign bit, summing all the weights where there are 1s and adding 1 to the results

School of Computer and Communication Engineering, UniMAP 5 DECIMAL VALUE OF SIGNED NUMBERS 1’s Complement form (example: +ve value) - Determine the decimal value of this signed binary number expressed in 1’s compliment summing the weight where there is 1s = +23

School of Computer and Communication Engineering, UniMAP 6 DECIMAL VALUE OF SIGNED NUMBERS 1’s Complement form (example: -ve value) - Determine the decimal value of this signed binary number expressed in 1’s compliment summing the weight where there is 1s = -24 Adding 1 to the result, the final decimal no is = -23

School of Computer and Communication Engineering, UniMAP 7 DECIMAL VALUE OF SIGNED NUMBERS 2’S COMPLEMENT: Decimal values of +ve and –ve no are determined by summing the weights in all by summing the weight in all positions where there are 1s and ignoring those positions where there are zeros The weight of the sign bit in a –ve no is given a –ve value

School of Computer and Communication Engineering, UniMAP 8 DECIMAL VALUE OF SIGNED NUMBERS 2’s Complement form (example: +ve value) - Determine the decimal value of this signed binary number expressed in 1’s compliment summing the weight where there is 1s = +86

School of Computer and Communication Engineering, UniMAP 9 DECIMAL VALUE OF SIGNED NUMBERS 2’s Complement form (example: -ve value) - Determine the decimal value of this signed binary number expressed in 1’s compliment summing the weight where there is 1s = -86

School of Computer and Communication Engineering, UniMAP 10 ARITHMETIC OPERATION WITH SIGNED NOs Addition: Conditions: 1.Both number +ve 2. +ve number with magnitude larger than –ve no 3.-ve number with magnitude larger than +ve no 4.Both no –ve

School of Computer and Communication Engineering, UniMAP 11 ARITHMETIC OPERATION WITH SIGNED NOs Substraction: Remember: The sign of a +ve or –ve binary number is changed by taking its 2’s complement To substract two signed numbers, take the 2’s complement of the subtrahend and add. Discard any final carry bit

School of Computer and Communication Engineering, UniMAP 12 ARITHMETIC OPERATION WITH SIGNED NOs Multiplication: 2 methods: Direct addition – lengthy 2. Partial product – most common Partial Product: Step 1 – determine if the sign of the multiplicand are the same or different. That’s will determines the end result -If the sign are the same, the product = +ve -If the sign are different, the product = -ve

School of Computer and Communication Engineering, UniMAP 13 Step 2 – Change any number to uncomplemented form. Usually from 2’s complemented form to true number Step 3 – Do a partial product multiplication. Use only the mag. bits. Ignore sign bit Step 4 – Add each successive partial product to get the final product. Step 5 – If sign bit is –ve, take the 2’s complement of the product. Else just leave it as the final result. Don’t forget to add the sign bit

School of Computer and Communication Engineering, UniMAP 14 ARITHMETIC OPERATION WITH SIGNED NOs Division: Step 1 – determine if the sign of the divident and divisor are the same or different. That’s will determines the sign of the quotient -If the sign are the same, the quotient = +ve -If the sign are different, the quotient = -ve Step 2 – Substract the divisor from the dividend using 2’s compliment addition to get the 1’s partial remainder and add 1 to quotient -If the partial remainder is +ve, go to step 3. If –ve, division is completed.

School of Computer and Communication Engineering, UniMAP 15 Step 3 – Substract the divisor from the partial remainder and add 1 to quotient. If result = +ve, repeat for the next partial remainder. If result = 0 or –ve, division is complete. ARITHMETIC OPERATION WITH SIGNED NOs

School of Computer and Communication Engineering, UniMAP ABCDEF ABCDEF BinaryOctalHexDec

School of Computer and Communication Engineering, UniMAP 17 Significant Digits Binary: Most significant digit Least significant digit Hexadecimal: 1D63A7A Most significant digit Least significant digit

School of Computer and Communication Engineering, UniMAP 18 Hexadecimal Number System Base 16 system Uses digits 0-9 & letters A,B,C,D,E,F Groups of four bits represent each base 16 digit

School of Computer and Communication Engineering, UniMAP 19 Hexadecimal to Decimal Conversion Convert 3B4F 16 to its decimal equivalent: Hex Digits 3 B 4 F xx x , Positional Values Products x

School of Computer and Communication Engineering, UniMAP 20 Decimal to Hexadecimal Conversion Convert to its hexadecimal equivalent: 830 / 16 = 51 R14 51 / 16 = 3 R3 3 / 16 = 0 R3 33E 16 = E in Hex

School of Computer and Communication Engineering, UniMAP 21 Number Conversion Binary to Hexadecimal Conversion (vice versa) 1. Grouping the binary position in 4-bit groups, starting from the least significant position.

School of Computer and Communication Engineering, UniMAP 22 Binary to Hexadecimal Conversion The easiest method for converting binary to hexadecimal is to use a substitution code Each hex number converts to 4 binary digits

School of Computer and Communication Engineering, UniMAP 23 Number Conversion  Example: Convert the following binary numbers to their hexadecimal equivalent (vice versa). a) b) 1F.C 16 Answer: a) b) or

School of Computer and Communication Engineering, UniMAP 24 Convert to hex using the 4-bit substitution code : Substitution Code 5 6 A E 6 A 56AE6A 16

School of Computer and Communication Engineering, UniMAP ABCDEF ABCDEF BinaryOctalHexDec NUMBER SYSTEMSNUMBER SYSTEMS

School of Computer and Communication Engineering, UniMAP 26 Octal Number System Also known as the Base 8 System Uses digits Readily converts to binary Groups of three (binary) digits can be used to represent each octal digit Also uses multiplication and division algorithms for conversion to and from base 10

School of Computer and Communication Engineering, UniMAP 27 Octal to Decimal Conversion Convert to its decimal equivalent: xx x Positional Values Products Octal Digits

School of Computer and Communication Engineering, UniMAP 28 Decimal to Octal Conversion Convert to its octal equivalent: 427 / 8 = 53 R3Divide by 8; R is LSD 53 / 8 = 6 R5Divide Q by 8; R is next digit 6 / 8 = 0 R6Repeat until Q =

School of Computer and Communication Engineering, UniMAP 29 Number Conversion Binary to Octal Conversion (vice versa) 1. Grouping the binary position in groups of three starting at the least significant position.

School of Computer and Communication Engineering, UniMAP 30 Octal to Binary Conversion Each octal number converts to 3 binary digits To convert to binary, just substitute code:

School of Computer and Communication Engineering, UniMAP 31 Number Conversion  Example: Convert the following binary numbers to their octal equivalent (vice versa). a) b) c) Answer: a) b) c)

School of Computer and Communication Engineering, UniMAP 32 Substitution code can also be used to convert binary to octal by using 3-bit groupings: Substitution Code

School of Computer and Communication Engineering, UniMAP 33 Digital Codes BCD (Binary Coded Decimal) Code 1. Represent each of the 10 decimal digits (0~9) as a 4-bit binary code.  Example: Convert 15 to BCD BCD Convert 10 to binary and BCD.

School of Computer and Communication Engineering, UniMAP 34 Digital Codes ASCII (American Standard Code for Information Interchange) Code 1. Used to translate from the keyboard characters to computer language

School of Computer and Communication Engineering, UniMAP 35 Digital Codes The Gray Code Only 1 bit changes Can’t be used in arithmetic circuits Binary to Gray Code and vice versa. DecimalBinaryGray Code

School of Computer and Communication Engineering, UniMAP 36 Q & A