# CHAPTER 2 Data Representation in Computer Systems

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 CHAPTER 2 Data Representation in Computer Systems 2.1 Introduction Positional Numbering Systems Decimal to Binary Conversions Converting Unsigned Whole Numbers Converting Fractions Converting between Power-of-Two Radices Signed Integer Representation Signed Magnitude Complement Systems Floating-Point Representation A Simple Model Floating-Point Arithmetic Floating-Point Errors The IEEE-754 Floating-Point Standard Character Codes Binary-Coded Decimal EBCDIC ASCII Unicode Codes for Data Recording and Transmission Non-Return-to-Zero Code Non-Return-to-Zero-Invert Encoding Phase Modulation (Manchester Coding) Frequency Modulation Run-Length-Limited Code Error Detection and Correction Cyclic Redundancy Check Hamming Codes Reed-Soloman 82 Chapter Summary 83 Further Reading 84 References 85 Review of Essential Terms and Concepts 85 Exercises 86 CMPS375 Class Notes Page 1/ 13 by Kuo-pao Yang

2 2.1 Introduction 37 This chapter describes the various ways in which computers can store and manipulate numbers and characters. Bit: The most basic unit of information in a digital computer is called a bit, which is a contraction of binary digit. Byte: In 1964, the designers of the IBM System/360 main frame computer established a convention of using groups of 8 bits as the basic unit of addressable computer storage. They called this collection of 8 bits a byte. Word: Computer words consist of two or more adjacent bytes that are sometimes addressed and almost always are manipulated collectively. Words can be 16 bits, 32 bits, 64 bits. Nibbles: Eight-bit bytes can be divided into two 4-bit halves call nibbles. 2.2 Positional Numbering Systems 38 Radix (or Base): The general idea behind positional numbering systems is that a numeric value is represented through increasing powers of a radix (or base). System Radix Allowable Digits Decimal 10 0,1,2,3,4,5,6,7,8,9 Binary 2 0,1 Octal 8 0,1,2,3,4,5,6,7 Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F FIGURE 2.1 Some Number to Remember EXAMPLE 2.1 Three numbers represented as powers of a radix = 2 * * * * * = 2 * * * 3 0 = = 1 * * * * * 2 0 = CMPS375 Class Notes Page 2/ 13 by Kuo-pao Yang

3 2.3 Decimal to Binary Conversions 38 There are two important groups of number base conversions: 1. Conversion of decimal numbers to base-r numbers 2. Conversion of base-r numbers to decimal numbers Converting Unsigned Whole Numbers 39 EXAMPLE 2.3 Convert to base 3 using the division-remainder method = EXAMPLE 2.4 Convert to binary = A binary number with N bits can represent unsigned integer from 0 to 2 n 1. Overflow: the result of an arithmetic operation is outside the range of allowable precision for the give number of bits Converting Fractions 41 EXAMPLE 2.6 Convert to base = EXAMPLE 2.7 Convert to binary with 4 bits to the right of the binary point. Reading from top to bottom, = to four binary places. We simply discard (or truncate) our answer when the desired accuracy has been achieved. EXAMPLE 2.8 Convert to base 3 First, convert to decimal = Then convert to base 3 We have = Converting between Power-of-Two Radices 44 EXAMPLE 2.9 Convert to octal and hexadecimal = Separate into groups of 3 for octal conversion = C9D 16 Separate into groups of 4 for octal conversion 2.4 Signed Integer Representation 44 By convention, a 1 in the high-order bit indicate a negative number Signed Magnitude 44 A signed-magnitude number has a sign as its left-most bit (also referred to as the high-order bit or the most significant bit) while the remaining bits represent the magnitude (or absolute value) of the numeric value. N bits can represent (2 n-1-1) to 2 n-1-1 EXAMPLE 2.10 Add to using signed-magnitude arithmetic (79) (35) = (114) There is no overflow in this example EXAMPLE 2.11 Add to using signed-magnitude arithmetic. An overflow condition and the carry is discarded, resulting in an incorrect sum. We obtain the erroneous result of (79) (99) = (50) EXAMPLE 2.12 Subtract from using signed-magnitude arithmetic. CMPS375 Class Notes Page 3/ 13 by Kuo-pao Yang

4 We find (99) (79) = (20) in signed-magnitude representation. EXAMPLE 2.14 EXAMPLE 2.15 The signed magnitude has two representations for zero, and (and mathematically speaking, the simple shouldn t happen!) Complement Systems 49 One s Complement o This sort of bit-flipping is very simple to implement in computer hardware. o EXAMPLE 2.16 Express and in 8-bit binary one s complement form = + ( ) = = - ( ) = o EXAMPLE 2.17 o EXAMPLE 2.18 o The primary disadvantage of one s complement is that we still have two representations for zero: and Two s Complement o Find the one s complement and add 1. o EXAMPLE 2.19 Express 23 10, , and in 8-bit binary two s complement form = + ( ) = = - ( ) = = = - ( ) = = o EXAMPLE 2.20 o EXAMPLE 2.21 o A Simple Rule for Detecting an Overflow Condition: If the carry in the sign bit equals the carry out of the bit, no overflow has occurred. If the carry into the sign bit is different from the carry out of the sign bit, over (and thus an error) has occurred. o EXAMPLE 2.22 Find the sum of and 8 10 in binary using two s complement arithmetic. A one is carried into the leftmost bit, but a zero is carried out. Because these carries are not equal, an overflow has occurred. o N bits can represent (2 n-1 ) to 2 n-1-1. With signed-magnitude number, for example, 4 bits allow us to represent the value -7 through +7. However using two s complement, we can represent the value -8 through +7. Integer Multiplication and Division o For each digit in the multiplier, the multiplicand is shifted one bit to the left. When the multiplier is 1, the shifted multiplicand is added to a running sum of partial products. o EXAMPLE Find the product of and o When the divisor is much smaller than the dividend, we get a condition known as divide underflow, which the computer sees as the equivalent of division by zero. CMPS375 Class Notes Page 4/ 13 by Kuo-pao Yang

5 o Computer makes a distinction between integer division and floating-point division. With integer division, the answer comes in two parts: a quotient and a remainder. Floating-point division results in a number that is expressed as a binary fraction. Floating-point calculations are carried out in dedicated circuits call floating-point units, or FPU. 2.5 Floating-Point Representation 55 In scientific notion, numbers are expressed in two parts: a fractional part call a mantissa, and an exponential part that indicates the power of ten to which the mantissa should be raised to obtain the value we need A Simple Model 56 In digital computers, floating-point number consist of three parts: a sign bit, an exponent part (representing the exponent on a power of 2), and a fractional part called a significand (which is a fancy word for a mantissa). 1 bit 5 bits 8 bits Sign bit Exponent Significand FIGURE 2.2 Floating-Point Representation Unbiased Exponent = * = * 2 17 Biased Exponent: We select 16 because it is midway between 0 and 31 (our exponent has 5 bits, thus allowing for 2 5 or 32 values). Any number larger than 16 in the exponent field will represent a positive value. Value less than 16 will indicate negative values = * 2 5 The biased exponent is = = * 2-1 EXAMPLE 2.23 A normalized form is used for storing a floating-point number in memory. A normalized form is a floating-point representation where the leftmost bit of the significand will always be a 1. Example: Internal representation of (10.25) 10 (10.25)10 = ( ) 2 (Un-normalized form) = ( ) 2 x 2 0. = ( ) 2 x 2 1. : = ( ) 2 x 2 4 (Normalized form) = ( ) 2 x 2 5 (Un-normalized form) = ( ) 2 x 2 6. CMPS375 Class Notes Page 5/ 13 by Kuo-pao Yang

6 Internal representation of (10.25) 10 is Floating-Point Arithmetic 58 EXAMPLE 2.24: Renormalizing we retain the larger exponent and truncate the loworder bit. EXAMPLE Floating-Point Errors 59 We intuitively understand that we are working in the system of real number. We know that this system is infinite. Computers are finite systems, with finite storage. The more bits we use, the better the approximation. However, there is always some element of error, no matter how many bits we use The IEEE-754 Floating-Point Standard 61 The IEEE-754 single precision floating point standard uses bias of 127 over its 8-bit exponent. An exponent of 255 indicates a special value. The double precision standard has a bias of 1023 over its 11-bit exponent. The special exponent value for a double precision number is 2047, instead of the 255 used by the single precision standard. Special bit patterns in IEEE Character Codes 62 Thus, human-understandable characters must be converted to computerunderstandable bit patterns using some sort of character encoding scheme Binary-Coded Decimal 62 Binary-coded Decimal (BCD) is a numeric coding system used primarily in IBM mainframe and midrange systems. When stored in an 8-bit byte, the upper nibble is called the zone and the lower part is called the digit. EXAMPLE 2.26 Represent in 3 bytes using packed BCD. The zoned-decimal coding for 1265 is: After packing, this string becomes: CMPS375 Class Notes Page 6/ 13 by Kuo-pao Yang

7 Adding the sign after the low-order digit and padding in high order bit should be 0000 for a result of: FIGURE 2.5 Binary-Coded Decimal EBCDIC 63 EBCDIC (Extended Binary Coded Decimal Interchange Code) expand BCD from 6 bits to 8 bits. See Page 64 FIGURE ASCII 63 ASCII: American Standard Code for Information Interchange In 1967, a derivative of this alphabet became the official standard that we now call ASCII Unicode 65 Both EBCDIC and ASCII were built around the Latin alphabet. In 1991, a new international information exchange code called Unicode. Unicode is a 16-bit alphabet that is downward compatible with ASCII and Latin-1 character set. Because the base coding of Unicode is 16 bits, it has the capacity to encode the majority of characters used in every language of the world. Unicode is currently the default character set of the Java programming language. CMPS375 Class Notes Page 7/ 13 by Kuo-pao Yang

8 2.7 Codes for Data Recording and Transmission Non-Return-to-Zero Code 68 The simplest data recording and transmission code is the non-return-to-zero (NRZ) code. NRZ encodes 1 as high and 0 as low. The coding of OK (in ASCII) is shown below. FIGURE 2.9 NRZ Encoding of OK Non-Return-to-Zero-Invert Encoding 69 The problem with NRZ code is that long strings of zeros and ones cause synchronization loss. Non-return-to-zero-invert (NRZI) reduces this synchronization loss by providing a transition (either low-to-high or high-to-low) for each binary 1. FIGURE 2.10 NRZI Encoding OK Phase Modulation (Manchester Coding) 70 Although it prevents loss of synchronization over long strings of binary ones, NRZI coding does nothing to prevent synchronization loss within long strings of zeros. Manchester coding (also known as phase modulation) prevents this problem by encoding a binary one with an up transition and a binary zero with a down transition. FIGURE 2.11 Phase Modulation (Manchester Coding) of the Word OK CMPS375 Class Notes Page 8/ 13 by Kuo-pao Yang

9 2.7.4 Frequency Modulation 70 For many years, Manchester code was the dominant transmission code for local area networks. It is, however, wasteful of communications capacity because there is a transition on every bit cell. A more efficient coding method is based upon the frequency modulation (FM) code. In FM, a transition is provided at each cell boundary. Cells containing binary ones have a mid-cell transition. FIGURE 2.12 Frequency Modulation Coding of OK At first glance, FM is worse than Manchester code, because it requires a transition at each cell boundary. If we can eliminate some of these transitions, we would have a more economical code. Modified FM does just this. It provides a cell boundary transition only when adjacent cells contain zeros. An MFM cell containing a binary one has a transition in the middle as in regular FM. FIGURE 2.13 Modified Frequency Modulation Coding of OK Run-Length-Limited Code 71 The main challenge for data recording and trans-mission is how to retain synchronization without chewing up more resources than necessary. Run-length-limited, RLL, is a code specifically designed to reduce the number of consecutive ones and zeros. Some extra bits are inserted into the code. But even with these extra bits RLL is remarkably efficient. An RLL(d,k) code dictates a minimum of d and a maximum of k consecutive zeros between any pair of consecutive ones. RLL(2,7) has been the dominant disk storage coding method for many years. An RLL(2,7) code contains more bit cells than its corresponding ASCII or EBCDIC character. However, the coding method allows bit cells to be smaller, thus closer together, than in MFM or any other code. CMPS375 Class Notes Page 9/ 13 by Kuo-pao Yang

10 The RLL(2,7) coding for OK is shown below, compared to MFM. The RLL code (bottom) contains 25% fewer transitions than the MFM code (top). FIGURE 2.16 MFM (top) and RLL(2, 7) Coding (bottom) for OK If the limiting factor in the design of a disk is the number of flux transitions per square millimeter, we can pack 50% more OKs in the same magnetic are using RLL than we could using MFM. RLL is used almost exclusively in the manufacture of high-capacity disk drive. 2.8 Error Detection and Correction 73 No communications channel or storage medium can be completely error-free Cyclic Redundancy Check 73 Cyclic redundancy check (CRC) is a type of checksum used primarily in data communications that determines whether an error has occurred within a large block or stream of information bytes. Arithmetic Modulo 2 The addition rules are as follows: = = = = 0 EXAMPLE 2.27 Find the sum of and modulo = (mod 2) EXAMPLE 2.28 Find the quotient and remainder when is divided by Quotient and Remainder Calculating and Using CRC o Suppose we want to transmit the information string: o The receiver and sender decide to use the (arbitrary) polynomial pattern, o The information string is shifted left by one position less than the number of positions in the divisor. I = o The remainder is found through modulo 2 division (at right) and added to the information string: = CMPS375 Class Notes Page 10/ 13 by Kuo-pao Yang

11 o If no bits are lost or corrupted, dividing the received information string by the agreed upon pattern will give a remainder of zero. o We see this is so in the calculation at the right. o Real applications use longer polynomials to cover larger information strings. A remainder other than zero indicates that an error has occurred in the transmission. This method work best when a large prime polynomial is used. There are four standard polynomials used widely for this purpose: o CRC-CCITT (ITU-T): X 16 + X 12 + X o CRC-12: X 12 + X 11 + X 3 + X 2 + X + 1 o CRC-16 (ANSI): X 16 + X 15 + X o CRC-32: X 32 + X 26 + X 23 + X 22 + X 16 + X 12 + X 11 + X 10 + X 8 + X 7 + X 6 + X 4 + X + 1 CRC-32 has been proven that CRCs using these polynomials can detect over 99.8% of all single-bit errors Hamming Codes 77 Data communications channels are simultaneously more error-prone and more tolerant of errors than disk systems. Hamming code use parity bits, also called check bits or redundant bits. The final word, called a code word is an n-bit unit containing m data bits and r check bits. n = m + r The Hamming distance between two code words is the number of bits in which two code words differ *** Hamming distance of these two code words is 3 The minimum Hamming distance, D(min), for a code is the smallest Hamming distance between all pairs of words in the code. Hamming codes can detect D(min) - 1 errors and correct [D(min) 1 / 2] errors. EXAMPLE 2.29 EXAMPLE D(min) = 3. Thus, this code can detect up to two errors and correct one single bit error. We are focused on single bit error. An error could occur in any of the n bits, so each code word can be associated with n erroneous words at a Hamming distance of 1. Therefore, we have n + 1 bit patterns for each code word: one valid code word, and n erroneous words. With n-bit code words, we have 2 n possible code words consisting of 2 m data bits (where m = n + r). This gives us the inequality: (n + 1) * 2 m < = 2 n CMPS375 Class Notes Page 11/ 13 by Kuo-pao Yang

12 Because m = n + r, we can rewrite the inequality as: (m + r + 1) * 2 m <= 2 m + r or (m + r + 1) <= 2 r EXAMPLE 2.31 Using the Hamming code just desccribed and even parity, encode the 8-bit ASCII character K. (The high-order bit will be zero.) Induce a single-bit error and then indicate how to locate the error. m = 8, we have (8 + r + 1) <= 2 r then We choose r = 4 Parity bit at 1, 2, 4, 8 Char K = = 1 5 = = = 2 6 = = = = = = 4 8 = 8 12 = We have the following code word as a result: Parity b1 = b3 + b5 + b7 + b9 + b11 = = 0 Parity b2 = b3 + b6 + b7 + b10 + b11 = = 1 Parity b4 = b5 + b6 + b7 = = 0 Parity b8 = b9 + b10 + b11 + b12 = = 1 Let s introduce an error in bit position b9, resulting in the code word: Parity b1 = b3 + b5 + b7 + b9 + b11 = = 1 (Error, should be 0) Parity b2 = b3 + b6 + b7 + b10 + b11 = = 1 (OK) Parity b4 = b5 + b6 + b7 = = 0 (OK) Parity b8 = b9 + b10 + b11 + b12 = = 0 (Error, should be 1) We found that parity bits 1 and 8 produced an error, and = 9, which in exactly where the error occurred Reed-Soloman 82 If we expect errors to occur in blocks, it stands to reason that we should use an errorcorrecting code that operates at a block level, as opposed to a Hamming code, which operates at the bit level. A Reed-Soloman (RS) code can be thought of as a CRC that operates over entire characters instead of only a few bits. RS codes, like CRCs, are systematic: The parity bytes are append to a block of information bytes. RS (n, k) code are defined using the following parameters: o s = The number of bits in a character (or symbol ). o k = The number of s-bit characters comprising the data block. CMPS375 Class Notes Page 12/ 13 by Kuo-pao Yang

13 o n = The number of bits in the code word. RS (n, k) can correct (n-k)/2 errors in the k information bytes. Reed-Soloman error-correction algorithms lend themselves well to implementation in computer hardware. They are implemented in high-performance disk drives for mainframe computers as well as compact disks used for music and data storage. These implementations will be described in Chapter 7. Chapter Summary 83 Computers store data in the form of bits, bytes, and words using the binary numbering system. Hexadecimal numbers are formed using four-bit groups called nibbles (or nybbles). Signed integers can be stored in one s complement, two s complement, or signed magnitude representation. Floating-point numbers are usually coded using the IEEE 754 floating-point standard. Character data is stored using ASCII, EBCDIC, or Unicode. Data transmission and storage codes are devised to convey or store bytes reliably and economically. Error detecting and correcting codes are necessary because we can expect no transmission or storage medium to be perfect. CRC, Reed-Soloman, and Hamming codes are three important error control codes. CMPS375 Class Notes Page 13/ 13 by Kuo-pao Yang

### CHAPTER 2 Data Representation in Computer Systems

CHAPTER 2 Data Representation in Computer Systems 2.1 Introduction 37 2.2 Positional Numbering Systems 38 2.3 Decimal to Binary Conversions 38 2.3.1 Converting Unsigned Whole Numbers 39 2.3.2 Converting

### Chapter 2. Data Representation in Computer Systems

Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting

### IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

IT 1204 Section 2.0 Data Representation and Arithmetic 2009, University of Colombo School of Computing 1 What is Analog and Digital The interpretation of an analog signal would correspond to a signal whose

### CMSC 2833 Lecture 18. Parity Add a bit to make the number of ones (1s) transmitted odd.

Parity Even parity: Odd parity: Add a bit to make the number of ones (1s) transmitted even. Add a bit to make the number of ones (1s) transmitted odd. Example and ASCII A is coded 100 0001 Parity ASCII

### Module 2: Computer Arithmetic

Module 2: Computer Arithmetic 1 B O O K : C O M P U T E R O R G A N I Z A T I O N A N D D E S I G N, 3 E D, D A V I D L. P A T T E R S O N A N D J O H N L. H A N N E S S Y, M O R G A N K A U F M A N N

### Positional Number System

Positional Number System A number is represented by a string of digits where each digit position has an associated weight. The weight is based on the radix of the number system. Some common radices: Decimal.

### Number Systems. Both numbers are positive

Number Systems Range of Numbers and Overflow When arithmetic operation such as Addition, Subtraction, Multiplication and Division are performed on numbers the results generated may exceed the range of

### BINARY SYSTEM. Binary system is used in digital systems because it is:

CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System

### Chapter 2 Data Representations

Computer Engineering Chapter 2 Data Representations Hiroaki Kobayashi 4/21/2008 4/21/2008 1 Agenda in Chapter 2 Translation between binary numbers and decimal numbers Data Representations for Integers

### 1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1.1 Introduction Given that digital logic and memory devices are based on two electrical states (on and off), it is natural to use a number

### Data Representations & Arithmetic Operations

Data Representations & Arithmetic Operations Hiroaki Kobayashi 7/13/2011 7/13/2011 Computer Science 1 Agenda Translation between binary numbers and decimal numbers Data Representations for Integers Negative

### Lecture 2: Number Systems

Lecture 2: Number Systems Syed M. Mahmud, Ph.D ECE Department Wayne State University Original Source: Prof. Russell Tessier of University of Massachusetts Aby George of Wayne State University Contents

### Chapter 4: Data Representations

Chapter 4: Data Representations Integer Representations o unsigned o sign-magnitude o one's complement o two's complement o bias o comparison o sign extension o overflow Character Representations Floating

### UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS (09 periods) Computer Arithmetic: Data Representation, Fixed Point Representation, Floating Point Representation, Addition and

### D I G I T A L C I R C U I T S E E

D I G I T A L C I R C U I T S E E Digital Circuits Basic Scope and Introduction This book covers theory solved examples and previous year gate question for following topics: Number system, Boolean algebra,

### Review of Number Systems

Review of Number Systems The study of number systems is important from the viewpoint of understanding how data are represented before they can be processed by any digital system including a digital computer.

### ±M R ±E, S M CHARACTERISTIC MANTISSA 1 k j

ENEE 350 c C. B. Silio, Jan., 2010 FLOATING POINT REPRESENTATIONS It is assumed that the student is familiar with the discussion in Appendix B of the text by A. Tanenbaum, Structured Computer Organization,

### Inf2C - Computer Systems Lecture 2 Data Representation

Inf2C - Computer Systems Lecture 2 Data Representation Boris Grot School of Informatics University of Edinburgh Last lecture Moore s law Types of computer systems Computer components Computer system stack

### Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Instructor: Nicole Hynes nicole.hynes@rutgers.edu 1 Fixed Point Numbers Fixed point number: integer part

### CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CS 265 Computer Architecture Wei Lu, Ph.D., P.Eng. 1 Part 1: Data Representation Our goal: revisit and re-establish fundamental of mathematics for the computer architecture course Overview: what are bits

### Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Contents Number systems and conversion Binary arithmetic Representation of negative numbers Addition of two s complement numbers Addition of one s complement numbers Binary s Readings Unit.~. UNIT NUMBER

### Digital Fundamentals

Digital Fundamentals Tenth Edition Floyd Chapter 1 Modified by Yuttapong Jiraraksopakun Floyd, Digital Fundamentals, 10 th 2008 Pearson Education ENE, KMUTT ed 2009 Analog Quantities Most natural quantities

### The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.

CS 320 Ch 10 Computer Arithmetic The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop. Signed integers are typically represented in sign-magnitude

### Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Course Schedule CS 221 Computer Architecture Week 3: Information Representation (2) Fall 2001 W1 Sep 11- Sep 14 Introduction W2 Sep 18- Sep 21 Information Representation (1) (Chapter 3) W3 Sep 25- Sep

### QUIZ ch.1. 1 st generation 2 nd generation 3 rd generation 4 th generation 5 th generation Rock s Law Moore s Law

QUIZ ch.1 1 st generation 2 nd generation 3 rd generation 4 th generation 5 th generation Rock s Law Moore s Law Integrated circuits Density of silicon chips doubles every 1.5 yrs. Multi-core CPU Transistors

### 10.1. Unit 10. Signed Representation Systems Binary Arithmetic

0. Unit 0 Signed Representation Systems Binary Arithmetic 0.2 BINARY REPRESENTATION SYSTEMS REVIEW 0.3 Interpreting Binary Strings Given a string of s and 0 s, you need to know the representation system

### Ch. 7 Error Detection and Correction

Ch. 7 Error Detection and Correction Error Detection and Correction Data can be corrupted during transmission. Some applications require that errors be detected and corrected. 2 1. Introduction Let us

### Floating Point Arithmetic

Floating Point Arithmetic CS 365 Floating-Point What can be represented in N bits? Unsigned 0 to 2 N 2s Complement -2 N-1 to 2 N-1-1 But, what about? very large numbers? 9,349,398,989,787,762,244,859,087,678

### Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Chapter 03: Computer Arithmetic Lesson 09: Arithmetic using floating point numbers Objective To understand arithmetic operations in case of floating point numbers 2 Multiplication of Floating Point Numbers

### Chapter 2: Number Systems

Chapter 2: Number Systems Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This two-valued number system is called binary. As presented earlier, there are many

### Floating Point. The World is Not Just Integers. Programming languages support numbers with fraction

1 Floating Point The World is Not Just Integers Programming languages support numbers with fraction Called floating-point numbers Examples: 3.14159265 (π) 2.71828 (e) 0.000000001 or 1.0 10 9 (seconds in

### A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

Complement Number Systems A complement number system is used to represent positive and negative integers A complement number system is based on a fixed length representation of numbers Pretend that integers

### Number Systems and Computer Arithmetic

Number Systems and Computer Arithmetic Counting to four billion two fingers at a time What do all those bits mean now? bits (011011011100010...01) instruction R-format I-format... integer data number text

### IEEE Standard for Floating-Point Arithmetic: 754

IEEE Standard for Floating-Point Arithmetic: 754 G.E. Antoniou G.E. Antoniou () IEEE Standard for Floating-Point Arithmetic: 754 1 / 34 Floating Point Standard: IEEE 754 1985/2008 Established in 1985 (2008)

### 4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

4 Operations On Data 4.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three categories of operations performed on data.

### Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

Announcements Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit Quiz 2 Monday on Number System Conversions

### The type of all data used in a C (or C++) program must be specified

The type of all data used in a C (or C++) program must be specified A data type is a description of the data being represented That is, a set of possible values and a set of operations on those values

### Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

N Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as: a n a a a The value of this number is given by: = a n Ka a a a a a

### Computer Arithmetic Ch 8

Computer Arithmetic Ch 8 ALU Integer Representation Integer Arithmetic Floating-Point Representation Floating-Point Arithmetic 1 Arithmetic Logical Unit (ALU) (2) Does all work in CPU (aritmeettis-looginen

### unused unused unused unused unused unused

BCD numbers. In some applications, such as in the financial industry, the errors that can creep in due to converting numbers back and forth between decimal and binary is unacceptable. For these applications

### Chapter 1. Digital Systems and Binary Numbers

Chapter 1. Digital Systems and Binary Numbers Tong In Oh 1 1.1 Digital Systems Digital age Characteristic of digital system Generality and flexibility Represent and manipulate discrete elements of information

### 4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

4 Operations On Data 4.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three categories of operations performed on data.

### Binary Addition & Subtraction. Unsigned and Sign & Magnitude numbers

Binary Addition & Subtraction Unsigned and Sign & Magnitude numbers Addition and subtraction of unsigned or sign & magnitude binary numbers by hand proceeds exactly as with decimal numbers. (In fact this

### umber Systems bit nibble byte word binary decimal

umber Systems Inside today s computers, data is represented as 1 s and 0 s. These 1 s and 0 s might be stored magnetically on a disk, or as a state in a transistor. To perform useful operations on these

### CS 101: Computer Programming and Utilization

CS 101: Computer Programming and Utilization Jul-Nov 2017 Umesh Bellur (cs101@cse.iitb.ac.in) Lecture 3: Number Representa.ons Representing Numbers Digital Circuits can store and manipulate 0 s and 1 s.

### l l l l l l l Base 2; each digit is 0 or 1 l Each bit in place i has value 2 i l Binary representation is used in computers

198:211 Computer Architecture Topics: Lecture 8 (W5) Fall 2012 Data representation 2.1 and 2.2 of the book Floating point 2.4 of the book Computer Architecture What do computers do? Manipulate stored information

### Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

Appendix F Number Systems Binary Numbers Decimal notation represents numbers as powers of 10, for example 1729 1 103 7 102 2 101 9 100 decimal = + + + There is no particular reason for the choice of 10,

### Computer Arithmetic Ch 8

Computer Arithmetic Ch 8 ALU Integer Representation Integer Arithmetic Floating-Point Representation Floating-Point Arithmetic 1 Arithmetic Logical Unit (ALU) (2) (aritmeettis-looginen yksikkö) Does all

### DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

Data Representation Data Representation Goal: Store numbers, characters, sets, database records in the computer. What we got: Circuit that stores 2 voltages, one for logic 0 (0 volts) and one for logic

### Electronic Data and Instructions

Lecture 2 - The information Layer Binary Values and Number Systems, Data Representation. Know the different types of numbers Describe positional notation Convert numbers in other bases to base 10 Convert

### MIPS Integer ALU Requirements

MIPS Integer ALU Requirements Add, AddU, Sub, SubU, AddI, AddIU: 2 s complement adder/sub with overflow detection. And, Or, Andi, Ori, Xor, Xori, Nor: Logical AND, logical OR, XOR, nor. SLTI, SLTIU (set

### Logic, Words, and Integers

Computer Science 52 Logic, Words, and Integers 1 Words and Data The basic unit of information in a computer is the bit; it is simply a quantity that takes one of two values, 0 or 1. A sequence of k bits

### DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes. Error Detection Codes

1 DATA REPRESENTATION Data Types Complements Fixed Point Representations Floating Point Representations Other Binary Codes Error Detection Codes 2 Data Types DATA REPRESENTATION Information that a Computer

### Lesson #1. Computer Systems and Program Development. 1. Computer Systems and Program Development - Copyright Denis Hamelin - Ryerson University

Lesson #1 Computer Systems and Program Development Computer Systems Computers are electronic systems that can transmit, store, and manipulate information (data). Data can be numeric, character, graphic,

### CMPS 10 Introduction to Computer Science Lecture Notes

CMPS Introduction to Computer Science Lecture Notes Binary Numbers Until now we have considered the Computing Agent that executes algorithms to be an abstract entity. Now we will be concerned with techniques

### Data Representation Type of Data Representation Integers Bits Unsigned 2 s Comp Excess 7 Excess 8

Data Representation At its most basic level, all digital information must reduce to 0s and 1s, which can be discussed as binary, octal, or hex data. There s no practical limit on how it can be interpreted

### Chapter 2 Bits, Data Types, and Operations

Chapter 2 Bits, Data Types, and Operations How do we represent data in a computer? At the lowest level, a computer is an electronic machine. works by controlling the flow of electrons Easy to recognize

### Data Representation. DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

Data Representation Data Representation Goal: Store numbers, characters, sets, database records in the computer. What we got: Circuit that stores 2 voltages, one for logic ( volts) and one for logic (3.3

### 1. Which of the following Boolean operations produces the output 1 for the fewest number of input patterns?

This is full of Test bank for Computer Science An Overview 12th Edition by Brookshear SM https://getbooksolutions.com/download/computer-science-an-overview-12th-editionby-brookshear-sm Test Bank Chapter

### Signed umbers. Sign/Magnitude otation

Signed umbers So far we have discussed unsigned number representations. In particular, we have looked at the binary number system and shorthand methods in representing binary codes. With m binary digits,

### Floating-point Arithmetic. where you sum up the integer to the left of the decimal point and the fraction to the right.

Floating-point Arithmetic Reading: pp. 312-328 Floating-Point Representation Non-scientific floating point numbers: A non-integer can be represented as: 2 4 2 3 2 2 2 1 2 0.2-1 2-2 2-3 2-4 where you sum

### CS101 Lecture 04: Binary Arithmetic

CS101 Lecture 04: Binary Arithmetic Binary Number Addition Two s complement encoding Briefly: real number representation Aaron Stevens (azs@bu.edu) 25 January 2013 What You ll Learn Today Counting in binary

### Chapter 4: Computer Codes. In this chapter you will learn about:

Ref. Page Slide 1/30 Learning Objectives In this chapter you will learn about: Computer data Computer codes: representation of data in binary Most commonly used computer codes Collating sequence Ref. Page

### ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

### UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES Structure 2.0 Introduction 2.1 Unit Objectives 2.2 Number Systems 2.3 Bits and Bytes 2.4 Binary Number System 2.5 Decimal Number System 2.6 Octal Number System

### Up next. Midterm. Today s lecture. To follow

Up next Midterm Next Friday in class Exams page on web site has info + practice problems Excited for you to rock the exams like you have been the assignments! Today s lecture Back to numbers, bits, data

### Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2 Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Website is up

### Number Systems & Encoding

Number Systems & Encoding Lecturer: Sri Parameswaran Author: Hui Annie Guo Modified: Sri Parameswaran Week2 1 Lecture overview Basics of computing with digital systems Binary numbers Floating point numbers

### Chapter 10 - Computer Arithmetic

Chapter 10 - Computer Arithmetic Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 10 - Computer Arithmetic 1 / 126 1 Motivation 2 Arithmetic and Logic Unit 3 Integer representation

### Floating Point Numbers. Lecture 9 CAP

Floating Point Numbers Lecture 9 CAP 3103 06-16-2014 Review of Numbers Computers are made to deal with numbers What can we represent in N bits? 2 N things, and no more! They could be Unsigned integers:

### Point-to-Point Links. Outline Encoding Framing Error Detection Sliding Window Algorithm. Fall 2004 CS 691 1

Point-to-Point Links Outline Encoding Framing Error Detection Sliding Window Algorithm Fall 2004 CS 691 1 Encoding Signals propagate over a physical medium modulate electromagnetic waves e.g., vary voltage

### CPE300: Digital System Architecture and Design

CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Arithmetic Unit 10122011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Recap Fixed Point Arithmetic Addition/Subtraction

### A Level Computing. Contents. For the Exam:

A Level Computing Contents For the Exam:... 1 Revision of Binary... 2 Computing Mathematics Revision... 2 Binary Addition/Subtraction revision... 3 BCD... 3 Sign and Magnitude... 4 2 s Compliment... 4

### IBM 370 Basic Data Types

IBM 370 Basic Data Types This lecture discusses the basic data types used on the IBM 370, 1. Two s complement binary numbers 2. EBCDIC (Extended Binary Coded Decimal Interchange Code) 3. Zoned Decimal

### C NUMERIC FORMATS. Overview. IEEE Single-Precision Floating-point Data Format. Figure C-0. Table C-0. Listing C-0.

C NUMERIC FORMATS Figure C-. Table C-. Listing C-. Overview The DSP supports the 32-bit single-precision floating-point data format defined in the IEEE Standard 754/854. In addition, the DSP supports an

### Characters, Strings, and Floats

Characters, Strings, and Floats CS 350: Computer Organization & Assembler Language Programming 9/6: pp.8,9; 9/28: Activity Q.6 A. Why? We need to represent textual characters in addition to numbers. Floating-point

### 1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

CS 64 Lecture 2 Data Representation Reading: FLD 1.2-1.4 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 ) + (1x10 0 ) 1010 10?= 1010 2?= 1

### Digital Computers and Machine Representation of Data

Digital Computers and Machine Representation of Data K. Cooper 1 1 Department of Mathematics Washington State University 2013 Computers Machine computation requires a few ingredients: 1 A means of representing

Data Link Networks Hardware Building Blocks Nodes & Links CS565 Data Link Networks 1 PROBLEM: Physically connecting Hosts 5 Issues 4 Technologies Encoding - encoding for physical medium Framing - delineation

### Number System (Different Ways To Say How Many) Fall 2016

Number System (Different Ways To Say How Many) Fall 2016 Introduction to Information and Communication Technologies CSD 102 Email: mehwish.fatima@ciitlahore.edu.pk Website: https://sites.google.com/a/ciitlahore.edu.pk/ict/

### CSN Telecommunications. 5: Error Coding. Data, Audio, Video and Images Prof Bill Buchanan

CSN874 Telecommunications 5: Error Coding Data, Audio, Video and Images http://asecuritysite.com/comms Prof Bill Buchanan CSN874 Telecommunications 5: Error Coding: Modulo-2 Data, Audio, Video and Images

### Chapter 3 Arithmetic for Computers (Part 2)

Department of Electr rical Eng ineering, Chapter 3 Arithmetic for Computers (Part 2) 王振傑 (Chen-Chieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Depar rtment of Electr rical Eng ineering, Feng-Chia Unive

### Roundoff Errors and Computer Arithmetic

Jim Lambers Math 105A Summer Session I 2003-04 Lecture 2 Notes These notes correspond to Section 1.2 in the text. Roundoff Errors and Computer Arithmetic In computing the solution to any mathematical problem,

### CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 4. September 09 CMSC417 Set 4 1

CSMC 417 Computer Networks Prof. Ashok K Agrawala 2009 Ashok Agrawala Set 4 1 The Data Link Layer 2 Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control

### Numeric Encodings Prof. James L. Frankel Harvard University

Numeric Encodings Prof. James L. Frankel Harvard University Version of 10:19 PM 12-Sep-2017 Copyright 2017, 2016 James L. Frankel. All rights reserved. Representation of Positive & Negative Integral and

### CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013 TOPICS TODAY Bits of Memory Data formats for negative numbers Modulo arithmetic & two s complement Floating point

### Fundamentals of Programming (C)

Borrowed from lecturer notes by Omid Jafarinezhad Fundamentals of Programming (C) Group 8 Lecturer: Vahid Khodabakhshi Lecture Number Systems Department of Computer Engineering Outline Numeral Systems

### Chapter 4 Section 2 Operations on Decimals

Chapter 4 Section 2 Operations on Decimals Addition and subtraction of decimals To add decimals, write the numbers so that the decimal points are on a vertical line. Add as you would with whole numbers.

### Numeric Variable Storage Pattern

Numeric Variable Storage Pattern Sreekanth Middela Srinivas Vanam Rahul Baddula Percept Pharma Services, Bridgewater, NJ ABSTRACT This paper presents the Storage pattern of Numeric Variables within the

### FAULT TOLERANT SYSTEMS

FAULT TOLERANT SYSTEMS http://www.ecs.umass.edu/ece/koren/faulttolerantsystems Part 6 Coding I Chapter 3 Information Redundancy Part.6.1 Information Redundancy - Coding A data word with d bits is encoded

CS6303 COMPUTER ARCHITECTURE LESSION NOTES UNIT II ARITHMETIC OPERATIONS ALU In computing an arithmetic logic unit (ALU) is a digital circuit that performs arithmetic and logical operations. The ALU is

### Floating-Point Numbers in Digital Computers

POLYTECHNIC UNIVERSITY Department of Computer and Information Science Floating-Point Numbers in Digital Computers K. Ming Leung Abstract: We explain how floating-point numbers are represented and stored

### Floating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. !

Floating point Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties Next time! The machine model Chris Riesbeck, Fall 2011 Checkpoint IEEE Floating point Floating

### Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Digital Arithmetic Digital Arithmetic: Operations and Circuits Dr. Farahmand Binary Arithmetic Digital circuits are frequently used for arithmetic operations Fundamental arithmetic operations on binary

### The data link layer has a number of specific functions it can carry out. These functions include. Figure 2-1. Relationship between packets and frames.

Module 2 Data Link Layer: - Data link Layer design issues - Error Detection and correction Elementary Data link protocols, Sliding window protocols- Basic Concept, One Bit Sliding window protocol, Concept

### CREATING FLOATING POINT VALUES IN MIL-STD-1750A 32 AND 48 BIT FORMATS: ISSUES AND ALGORITHMS

CREATING FLOATING POINT VALUES IN MIL-STD-1750A 32 AND 48 BIT FORMATS: ISSUES AND ALGORITHMS Jeffrey B. Mitchell L3 Communications, Telemetry & Instrumentation Division Storm Control Systems ABSTRACT Experimentation

### CS321: Computer Networks Error Detection and Correction

CS321: Computer Networks Error Detection and Correction Dr. Manas Khatua Assistant Professor Dept. of CSE IIT Jodhpur E-mail: manaskhatua@iitj.ac.in Error Detection and Correction Objective: System must

### CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes

Multiple-byte data CMSC 313 Lecture 03 big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes UMBC, CMSC313, Richard Chang 4-5 Chapter

### Basic data types. Building blocks of computation

Basic data types Building blocks of computation Goals By the end of this lesson you will be able to: Understand the commonly used basic data types of C++ including Characters Integers Floating-point values