NUMBER SYSTEMS AND CODES. CS 3402--Digital LogicNumber Systems and Codes2 Outline Number systems –Number notations –Arithmetic –Base conversions –Signed.

Slides:



Advertisements
Similar presentations
ECE 331 – Digital System Design
Advertisements

A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
ECE 331 – Digital System Design
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
ECE 301 – Digital Electronics Number Systems and Conversion, Binary Arithmetic, and Representation of Negative Numbers (Lecture #10) The slides included.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Number System and Codes
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Data Representation – Chapter 3 Sections 3-2, 3-3, 3-4.
Mantıksal Tasarım – BBM231 M. Önder Efe
1.6 Signed Binary Numbers.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Digital Systems and Logic Design
Logic and Digital System Design - CS 303
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Dept. of Computer Science Engineering Islamic Azad University of Mashhad 1 DATA REPRESENTATION Dept. of Computer Science Engineering Islamic Azad University.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
1.11, 1.12, 1.13, 1.14, 1.18, 1.20, 1.23, 1.24, 1.25, 1.32, 1.33.
Chapter 2 Number Systems + Codes. Overview Objective: To use positional number systems To convert decimals to binary integers To convert binary integers.
Yuh-Jzer JoungDigital Systems1 Number Systems decimal number : 7397=7× × × ×10 0 a 4 a 3 a 2 a 1 a 0. a -1 a -2 = a 4 ×10 4 +a 3 ×10.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
1 Digital Design: Number Systems Credits : Slides adapted from: J.F. Wakerly, Digital Design, 4/e, Prentice Hall, 2006 C.H. Roth, Fundamentals of Logic.
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 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.
CE1111 :Digital Logic Design lecture 01 Introduction Dr. Atef Ali Ibrahim.
Computer Number Systems. d n-1 d n-2 d n d 2-m d 1-m d -m Conventional Radix Number r is the radixd i is a digit d i Є {0, 1, ….., r – 1 } -m ≤
ECE 331 – Digital System Design
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.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Summer 2012ETE Digital Electronics1 Binary Arithmetic of Signed Binary 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.
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
DIGITAL SYSTEMS Number systems & Arithmetic Rudolf Tracht and A.J. Han Vinck.
Chapter 1: Binary Systems
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
Digital Logic & Design Adil Waheed Lecture 03. Range of Binary Numbers Processors can handle 64-bit unsigned binary values. Maximum unsigned decimal number.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
BINARY SYSTEMS ENGR. KASHIF SHAHZAD 1. BINARY NUMBERS 1/2 Internally, information in digital systems is of binary form groups of bits (i.e. binary numbers)
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.
11001 / 101, / ) Perform subtraction on the given unsigned binary numbers using the 2's complement of the subtrahend. Where the result.
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.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
Data Representation COE 308 Computer Architecture
Data Representation ICS 233
Lec 3: Data Representation
Data Representation.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
11001 / 101 , / ) Perform subtraction on the given unsigned binary numbers using the 2's complement of the subtrahend. Where the.
CHAPTER 1 : INTRODUCTION
Chapter 2 Data Types and Representations
Chapter 3 Data Representation
CS1010 Programming Methodology
Data Representation in Computer Systems
Numbering System TODAY AND TOMORROW 11th Edition
Number Systems Lecture 2.
Digital Logic Design (CSNB163)
Data Representation ICS 233
ECE 331 – Digital System Design
Computer Architecture CST 250
Data Representation COE 308 Computer Architecture
Presentation transcript:

NUMBER SYSTEMS AND CODES

CS Digital LogicNumber Systems and Codes2 Outline Number systems –Number notations –Arithmetic –Base conversions –Signed number representation Codes –Decimal codes –Gray code –Error detection code –ASCII code

CS Digital LogicNumber Systems and Codes3 Number Systems The decimal (real), binary, octal, hexadecimal number systems are used to represent information in digital systems. Any number system consists of a set of digits and a set of operators (+, , ,  ).

CS Digital LogicNumber Systems and Codes4 Radix or Base Decimal (base 10) Binary (base 2) 0 1 Octal (base 8) Hexadecimal (base 16) A B C D E F The radix or base of the number system denotes the number of digits used in the system.

CS Digital LogicNumber Systems and Codes5 DecimalBinaryOctalHexadecimal A B C D E F

CS Digital LogicNumber Systems and Codes6 Positional Notation It is convenient to represent a number using positional notation. A positional notation is written as a sequence of digits with a radix point separating the integer and fractional part. where r is the radix, n is the number of digits of the integer part, and m is the number digits of the fractional part.

CS Digital LogicNumber Systems and Codes7 Polynomial Notation A number can be explicitly represented in polynomial notation. where r p is a weighted position and p is the position of a digit.

CS Digital LogicNumber Systems and Codes8 Examples In binary number system In octal number system In hexadecimal number system

CS Digital LogicNumber Systems and Codes9 Arithmetic (101101) 2 +(11101) 2 : Addition: In binary number system,

CS Digital LogicNumber Systems and Codes10 Addition (6254) 8 +(5173) 8 : In octal number system, (9F1B) 16 +(4A36) 16 : F1B 4A36 D951 In hexadecimal number system,

CS Digital LogicNumber Systems and Codes11 Subtraction (101101) 2 -(11011) 2 : In binary number system,

CS Digital LogicNumber Systems and Codes12 Subtraction In octal number system, In hexadecimal number system, (6254) 8 -(5173) 8 : (9F1B) 16 -(4A36) 16 : F1B 4A36 54E5

CS Digital LogicNumber Systems and Codes13 Multiplication (1101) 2  (1001) 2 :  In binary number system,

CS Digital LogicNumber Systems and Codes14 Division ( ) 2  (1001) 2 : In binary number system,

CS Digital LogicNumber Systems and Codes15 Base Conversions Convert ( ) 2 to base 8

CS Digital LogicNumber Systems and Codes16 Base Conversion Convert ( ) 2 to base 10

CS Digital LogicNumber Systems and Codes17 Base Conversion Convert ( ) 2 to base 16

CS Digital LogicNumber Systems and Codes18 Base Conversion from base 8 Convert (372) 8 to base 2 Convert (372) 8 to base 10 Convert (372) 8 to base 16

CS Digital LogicNumber Systems and Codes19 Base Conversion from base 16 Convert (9F2) 16 to base 2 Convert (9F2) 16 to base 8 Convert (9F2) 16 to base 10

CS Digital LogicNumber Systems and Codes20 Binomial expansion (series substitution) To convert a number in base r to base p. –Represent the number in base p in binomial series. –Change the radix or base of each term to base p. –Simplify.

CS Digital LogicNumber Systems and Codes21 Convert Base 10 to Base r Convert (174) 10 to base 8 Therefore (174) 10 = (256) LSB MSB 00

CS Digital LogicNumber Systems and Codes22 Convert Base 10 to Base r Convert (0.275) 10 to base 8 Therefore (0.275) 10 = (  ) 8 8   2.200MSD 8         3.200LSD

CS Digital LogicNumber Systems and Codes23 Convert Base 10 to Base r Convert ( ) 10 to base 2 Therefore ( ) 10 = (  ) 2 2   MSD 2         LSD

CS Digital LogicNumber Systems and Codes24 Signed Number Representation There are 3 systems to represent signed numbers in binary number system: – Signed-magnitude –1's complement –2's complement

CS Digital LogicNumber Systems and Codes25 Signed-magnitude system In signed-magnitude systems, the most significant bit represents the number's sign, while the remaining bits represent its absolute value as an unsigned binary magnitude. –If the sign bit is a 0, the number is positive. –If the sign bit is a 1, the number is negative.

CS Digital LogicNumber Systems and Codes26 Signed-magnitude system

CS Digital LogicNumber Systems and Codes27 1's Complement system A 1's complement system represents the positive numbers the same way as in the signed-magnitude system. The only difference is negative number representations. Let be N any positive integer number and be a negative 1's complement integer of N. If the number length is n bits, then

CS Digital LogicNumber Systems and Codes28 Example of 1's Complement For example in a 4-bit system, 0101 represents +5 and 1010 represents  5

CS Digital LogicNumber Systems and Codes29 1's Complement system

CS Digital LogicNumber Systems and Codes30 2's Complement system A 2's complement system is similar to 1's complement system, except that there is only one representation for zero. Let be N any positive integer number and be a negative 2's complement integer of N. If the number length is n bits, then

CS Digital LogicNumber Systems and Codes31 Example of 2's Complement For example in a 4-bit system, 0101 represents +5 and 1011 represents  5

CS Digital LogicNumber Systems and Codes32 2's Complement system

CS Digital LogicNumber Systems and Codes33 Addition and Subtraction in Signed and Magnitude

CS Digital LogicNumber Systems and Codes34 Addition and Subtraction in 1’s Complement

CS Digital LogicNumber Systems and Codes35 Addition and Subtraction in 2’s Complement

CS Digital LogicNumber Systems and Codes36 Overflow Conditions Carry-in  carry-out Carry-in = carry-out

CS Digital LogicNumber Systems and Codes37 Addition and Subtraction in Hexadecimal System Addition Subtraction

CS Digital LogicNumber Systems and Codes38 Codes Decimal codes Gray code Error detection code ASCII code

CS Digital LogicNumber Systems and Codes39 Decimal codes Decimal DigitBCDExcess

CS Digital LogicNumber Systems and Codes40 Gray Code Decimal EquivalentBinary CodeGray Code

CS Digital LogicNumber Systems and Codes41 Error detection code Parity Bit (odd)Message

CS Digital LogicNumber Systems and Codes42 Error detection code Parity Bit (even)Message

CS Digital LogicNumber Systems and Codes43 ASCII Code ASCII: American Standard Code for Information Interchange. Used to represent characters and textual information Each character is represented with 1 byte –upper and lower case letters: a..z and A..Z –decimal digits -- 0,1,…,9 – punctuation characters -- ;,. : –special characters --$ / { –control characters -- carriage return (CR), line feed (LF), beep

CS Digital LogicNumber Systems and Codes44 Assignment 1 Page 74 –1.1: Only A+B and A  B (a), (c), (f), and (g) –1.2: Only A+B and A  B (a), (c) –1.3: Only A+B and A  B (a), (c) –1.4: (a), (c), (e) –1.5: (a), (c), (e) –1.6: (a), (e) –1.7: (a), (b) –1.8: (a), (b) –1.10: (a), (c) –1.11: (a), (c) –1.12: (a), (c) –1.13: (a), (b)