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.

Slides:



Advertisements
Similar presentations
CHAPTER 2 Number Systems, Operations, and Codes
Advertisements

Digital Fundamentals Floyd Chapter 2 Tenth Edition
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
Digital Systems Number Systems and Codes Wen-Hung Liao, Ph.D.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Mantıksal Tasarım – BBM231 M. Önder Efe
Number Systems Lecture 02.
1.6 Signed Binary Numbers.
Dr. Bernard Chen Ph.D. University of Central Arkansas
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
Data Representation – Binary Numbers
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.
Chap. 3 Data Representation
Chapter 3 Data Representation
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Number Systems Spring Semester 2013Programming and Data Structure1.
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.
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.
Computer System Architecture © Korea Univ. of Tech. & Edu. Dept. of Info. & Comm. Chap. 2 Number Systems and Codes Binary to Decimal Conversions.
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.
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 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 Representation of Data within the Computer Oct., 1999(Revised 2001 Oct)
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
Chapter 1 Digital Systems and Binary Numbers
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
Chapter 1: Binary Systems
ECE DIGITAL LOGIC LECTURE 4: BINARY CODES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/26/2016.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
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)
Digital Logic Design Ch1-1 Chapter 1 Digital Systems and Binary Numbers Mustafa Kemal Uyguroğlu Digital Logic Design I.
Digital Systems: Number Systems and Codes Wen-Hung Liao, Ph.D.
DATA REPRESENTATION Data Types Complements Fixed Point Representations
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.
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.
Chapter 1 Digital Systems and Binary Numbers
Programming and Data Structure
NUMBER SYSTEMS.
Lec 3: Data Representation
CS2100 Computer Organisation
Number Representation
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
CHAPTER 1 : INTRODUCTION
Binary Arithmetic Binary arithmetic is essential in all digital computers and in many other types of digital systems. Addition, Subtraction, Multiplication,
Digital Systems and Binary Numbers
Chapter 3 Data Representation
Chapter 1 Digital Systems and Binary Numbers
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.
Data Representation Data Types Complements Fixed Point Representation
Digital Logic & Design Lecture 03.
Numbering System TODAY AND TOMORROW 11th Edition
Data Representation – Chapter 3
Digital Systems and Binary Numbers
ECE 331 – Digital System Design
Chap. 2 Number Systems and Codes
Chapter3 Fixed Point Representation
CHAPTER 69 NUMBER SYSTEMS AND CODES
Presentation transcript:

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 and other binary-coded information l Control information is a bit or a group of bits used to specify the sequence of command signals  Data types found in the registers of digital computers l Numbers used in arithmetic computations l Letters of the alphabet used in data processing l Other discrete symbols used for specific purpose  Number Systems l Base or Radix r system : uses distinct symbols for r digits l Most common number system :Decimal, Binary, Octal, Hexadecimal l Positional-value(weight) System : r 2 r 1 r 0.r -1 r -2 r -3 »Multiply each digit by an integer power of r and then form he sum of all weighted digits Chap. 3 Data Representation

 Decimal System/Base-10 System l Composed of 10 symbols or numerals(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0)  Binary System/Base-2 System l Composed of 10 symbols or numerals(0, 1) l Bit = Binary digit  Hexadecimal System/Base-16 System : Tab. 3-2 l Composed of 16 symbols or numerals(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)  Binary-to-Decimal Conversions = (1 x 2 3 ) + (0 x 2 2 )+ (1 x 2 1 ) + (1 x 2 o ) + (1 x 2 -1 ) + (0 x 2 -2 ) + (1 x 2 -3 ) = =  Decimal-to-Binary Conversions Repeated division(See p. 69, Fig. 3-1) 37 / 2 = 18 remainder 1 (binary number will end with 1) : LSB 18 / 2 = 9 remainder 0 9 / 2 = 4 remainder 1 4 / 2 = 2 remainder 0 2 / 2 = 1 remainder 0 1 / 2 = 0 remainder 1 (binary number will start with 1) : MSB Read the result upward to give an answer of = 소수점 변환 x 2 = integer 0 MSB x 2 = integer x 2 = integer 1 LSB Read the result downward =.011 2

 Hex-to-Decimal Conversion 2AF 16 = (2 x 16 2 ) + (10 x 16 1 ) + (15 x 16 o ) = =  Decimal-to-Hex Conversion / 16 = 26 remainder 7 (Hex number will end with 7) : LSB / 16 = 1 remainder / 16 = 0 remainder 1 (Hex number will start with 1) : MSB Read the result upward to give an answer of = 1A7 16  Hex-to-Binary Conversion 9F2 16 = 9 F 2 = = Table 3-2 HexBinaryDecimal A B C D E F  Binary-to-Hex Conversion = A 6 = 3A6 16

 Binary-Coded-Decimal Code l Each digit of a decimal number is represented by its binary equivalent (Decimal) (BCD) l Only the four bit binary numbers from 0000 through 1001 are used l Comparison of BCD and Binary = (Binary) - require only 8 bits = BCD (BCD) - require 12 bits  Alphanumeric Representation l Alphanumeric character set(Tab. 3-4) »10 decimal digits, 26 letters, special character($, +, =,….) »A complete list of ASCII : p. 384, Tab l ASCII(American Standard Code for Information Interchange) »Standard alphanumeric binary code uses seven bits to code 128 characters

n 3-2 Complements  Complements are used in digital computers for simplifying the subtraction operation and for logical manipulation  There are two types of complements for base r system l 1) r’s complement 2) (r-1)’s complement »Binary number : 2’s or 1’s complement »Decimal number : 10’s or 9’s complement  (r-1)’s Complement l (r-1)’s Complement of N = (r n -1)-N »9’s complement of N= ( ) = ( ) = = »1’s complement of N= (2 6 -1) = ( ) = =  r’s Complement l r’s Complement of N = r n -N »10’s complement of 2389= = 7611 »2’s complement of = = N : given number r : base n : digit number (N) (9’s com) = (N) (1’s com) = * r’s Complement (r-1)’s Complement +1 =(r n -1)-N+1= r n -N

 Subtraction of Unsigned Numbers l 1) M + (r n -N) l 2) M  N : Discard end carry, Result = M-N l 3) M  N : No end carry, Result = - r’s complement of (N-M) »Decimal Example) 72532(M) (N) = (10’s complement of 13250) Result = »Binary Example) (X) (Y) = (2’s complement of ) Result = (M-N), N  (M) (N) = (10’s complement of 72532) Result = -(10’s complement of 40718) = -( ) = M  NM  N Discard End Carry No End Carry (X) (Y) = (2’s complement of ) Result = -(2’s complement of ) = -( ) = X  YX  Y

n 3-3 Fixed-Point Representation  Computers must represent everything with 1’s and 0’s, including the sign of a number and fixed/floating point number  Binary/Decimal Point l The position of the binary/decimal point is needed to represent fractions, integers, or mixed integer-fraction number  Two ways of specifying the position of the binary point in a register l 1) Fixed Point : the binary point is always fixed in one position »A binary point in the extreme left of the register(Fraction : 0.xxxxx) »A binary point in the extreme right of the register(Integer : xxxxx.0) n The binary point is not actually present, but the number stored in the register is treated as a fraction or as an integer l 2) Floating Point : the second register is used to designate the position of the binary point in the first register(refer to 3-4)  Integer Representation l Signed-magnitude representation l Signed-1’s complement representation l Signed-2’s complement representation *Numeric Data 1) Fixed Point 2) Floating Point * ) 0.25, 2) 32.0, 3) * MSB for Sign “0” is plus + “1” is minus - Most Common

 Arithmetic Addition l Addition Rules of Ordinary Arithmetic »The signs are same : sign= common sign, result= add »The signs are different : sign= larger sign, result= larger-smaller l Addition Rules of the signed 2’s complement »Add the two numbers including their sign bits »Discard any carry out of the sign bit position  Arithmetic Subtraction l Subtraction is changed to an Addition »(± A) - (+ B) = (± A) + (- B) »(± A) - ( - B) = (± A) + (+ B)  Overflow l Two numbers of n digits each are added and the sum occupies n+1 digits l n + 1 bit cannot be accommodated in a register with a standard length of n bits(many computer detect the occurrence of an overflow, and a corresponding OF is set) (-12) + (-13) = -25 (+12) + (+13) = +25 (+25) + (-37) = = -12 *Addition Exam) * Subtraction Exam) (- 6) - ( - 13) = = ’s comp of = = = +7 Discard End Carry

 Overflow l An overflow may occur if the two numbers added are both positive or both negative »When two unsigned numbers are added n an overflow is detected from the end carry out of the MSB position »When two signed numbers are added n the MSB always represents the sign - the sign bit is treated as part of the number - the end carry does not indicate an overflow * Overflow Exam) out in out in carries 0 1 carries  Overflow Detection l Detected by observing the carry into the sign bit position and the carry out of the sign bit position l If these two carries are not equal, an overflow condition is produced(Exclusive-OR gate = 1)  Decimal Fixed-Point Representation l A 4 bit decimal code requires four F/Fs for each decimal digit l The representation of 4385 in BCD requires 16 F/Fs ( ) l The representation in decimal is wasting a considerable amount of storage space and the circuits required to perform decimal arithmetic are more complex * Advantage * Computer I/O data are generated by people who use the decimal system *Decimal Exam) (+375) + (-240) (10’s comp of 240)= ( ) ( ) ( )

n 3-4 Floating-Point Representation  The floating-point representation of a number has two parts l 1) Mantissa : signed, fixed-point number l 2) Exponent : position of binary(decimal) point  Scientific notation : m x r e ( x ) l m : mantissa, r : radix, e : exponent  Example : m x 2 e = +( ) 2 x 2 +4  Normalization l Most significant digit of mantissa is nonzero n 3-5 Other Binary Codes  Gray Code l Gray code changes by only one bit (Tab bit Gray Code ) »The data must be converted into digital form before they can be used by a digital computer(Analog to Digital Converter) »The analog data are represented by the continuous change of a shaft position(Rotary Encoder of Motor) * Decimal Fraction Exponent Fraction Exponent

n 3-6 Error Detection Codes  Binary information transmitted through some form of communication medium is subject to external noise  Parity Bit l An extra bit included with a binary message to make the total number of 1’s either odd or even(Tab. 3-7)  Even-parity method l The value of the parity bit is chosen so that the total number of 1s (including the parity bit) is an even number  Odd-parity method l Exactly the same way except that the total number of 1s is an odd number TransmitterReceiver ~ ~  Added parity bit