William Sandqvist It could be pedagogical to study a small 4 bit nibble computer in order to understand how real numbers are stored and.

Slides:



Advertisements
Similar presentations
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
Advertisements

Fixed Point Numbers The binary integer arithmetic you are used to is known by the more general term of Fixed Point arithmetic. Fixed Point means that we.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
CENG536 Computer Engineering department Çankaya University.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Floating Point Numbers
1 IEEE Floating Point Revision Guide for Phase Test Week 5.
CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (2)
Computer ArchitectureFall 2007 © September 5, 2007 Karem Sakallah CS 447 – Computer Architecture.
Integer Arithmetic Floating Point Representation Floating Point Arithmetic Topics.
Computer ArchitectureFall 2008 © August 27, CS 447 – Computer Architecture Lecture 4 Computer Arithmetic (2)
CPS Computer Architecture Assignment 4: Multiplication, Division, Floating Point.
Computer Science 210 Computer Organization Floating Point Representation.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Binary Representation and Computer Arithmetic
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
Simple Data Type Representation and conversion of numbers
Computer Organization and Architecture Computer Arithmetic Chapter 9.
Computer Arithmetic Nizamettin AYDIN
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Computer Arithmetic.
1 Lecture 5 Floating Point Numbers ITEC 1000 “Introduction to Information Technology”
CEN 316 Computer Organization and Design Computer Arithmetic Floating Point Dr. Mansour AL Zuair.
Fixed-Point Arithmetics: Part II
Computing Systems Basic arithmetic for computers.
ECE232: Hardware Organization and Design
Data Representation in Computer Systems
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
9.4 FLOATING-POINT REPRESENTATION
CSC 221 Computer Organization and Assembly Language
ECE 456 Computer Architecture
Conversion to Larger Number of Bits Ex: Immediate Field (signed 16 bit) to 32 bit Positive numbers have implied 0’s to the left. So, put 16 bit number.
1 Number Systems Lecture 10 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
CSNB374: Microprocessor Systems Chapter 1: Introduction to Microprocessor.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
Short Cuts for Multiply and Divide For Positive Numbers 1. Multiply by 2 k is the same as shift k to the left, 0 fill 2. Divide by 2 k is the same as.
CSE 340 Simulation Modeling | MUSHFIQUR ROUF CSE340:
©Brooks/Cole, 2003 Chapter 3 Number Representation.
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
Chapter 9 Computer Arithmetic
William Stallings Computer Organization and Architecture 8th Edition
Floating Point Operations
William Stallings Computer Organization and Architecture 7th Edition
Chapter 6 Floating Point
Data Representation Data Types Complements Fixed Point Representation
Computer Arithmetic Multiplication, Floating Point
ECEG-3202 Computer Architecture and Organization
Storing Negative Integers
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Chapter 8 Computer Arithmetic
IT11004: Data Representation and Organization
Chapter3 Fixed Point Representation
Computer Organization and Assembly Language
Presentation transcript:

William Sandqvist It could be pedagogical to study a small 4 bit nibble computer in order to understand how real numbers are stored and handled! Normaly 32 bit registers are used, but the principles from the nibble computer will remain the same.

William Sandqvist The first microprocessor Intel was a 4 bit (nibble) processor. The customer Busicom wanted a dedicated calculator chip, but the disobedient engineers created a general purpose processor.

William Sandqvist 4.3 Imagine a ”Nibble” computer Computer registers are ”rings”. A four bit register can hold 2 4 = 16 numbers. Either 8 positive (+0…+7) and 8 negative (-1…-8) ”signed numbers”, or 16 (0…F) ”unsigned numbers”. If a result is bigger than 16, the register overflows. (In some processors indicated with a Carry-flag).

William Sandqvist Real numbers in Nibble computer Imagine a ”Nibble” floating point format! Imagine a ”Nibble” fixed point format, Q 3 !

William Sandqvist Q 3 [b 3 b 2 b 1 b 0 ] Fixed point format The Q-format is the same as the signed numbers but downscaled: -1 < Q 3 < 1-b 0 The step between numbers is the weight of b Fixed point circle!Fixed point number line!

William Sandqvist Floating point (Nibble) Floating point format Sign b 3 Significand 1.b = = Exponent b 2 b 1 -1 (exess1) = = = =  0.5 =  1 =  2 =  4 =  0.5 =  1 =  2 =  4 =  0.5 =  1 =  2 =  4 =  0.5 =  1 =  2 =  4 = -6 Floating point number line!

William Sandqvist Quantisation error Maximum Quantisation Error MQE: Fixed point: (2 -3 )/2 = 2 -4 = 0.125/2 = Float: (6-4)/2 = 1

William Sandqvist The number Zero In fixed point formats the number zero is represented as [0000] In floating point format, there is no representation for zero! We could use, 0000 as +0 and 1000 as –0, as in the IEEE standard format! The IEEE 32 and 64 bit float standard Floating point circle!

William Sandqvist Converting Real numbers to Binary Hawe you forgotten how?

William Sandqvist 4.4 Six bit float Significand 1.b 2 b 1 b = = = = = = = = Exponent b 4 b 3 -1 (exess1) 00-1 = = = = = = = = = =  2 -2 exponent -2 not representable = =  2 -1 representable -1, = =  2 0 representable = =  2 2 significand not representable = =  2 2 representable

William Sandqvist Float Addition Algorithm: 1. Check for zeroes 2. Align significands 3. Add/Sub significands 4. Normalize result a =   b =   Align significands. 10 > 01 shift smaller number a to right to get same exponent: Significand exponent 10 Add significands: Normalize result: exp 10  exp 11 Rounding: ~ Result: a = b = 2.5 a+b = 4.5 (4.375)

William Sandqvist Float Multiplication Simpler than addition! Algorithm: 1. Check for zeroes 2. Add exponents and subtract Bias 3. Multiply significands 4. Normalize Exponents: Bias = 1 exp = = 10 Multiply significands Normalize result: exp 10  exp 11 Rounding: ~ Result: a = b = 2.5 a*b = 4.5 (4.6875)

William Sandqvist IEEE – 32 bit float Dec  IEEE-754 By using the exess–127 format for the exponent, we can compare floats as if they were sign and magnitude integers!

William Sandqvist

5-4 Cache conflict misses for (i = 0; i < 50; i++) for(j = 0; j < 4; j++) x[i][j] = a[i][j] * c[i]; Data cache 1 k Word (Word = 32 bit). Cache line 4 Words. Conflict misses depending on memory placement of x and a ?

William Sandqvist Memory – Cache adressmapping Memorys are often Byte- organized, but we could draw it as if it was organized in Memory-lines with the same size as the Cache-line. Direct addressmapping: Memory-line: i  Cache-line: j = i % K If the CPU needs a data-item in a line, the whole line is transfered fom memory to cache.

William Sandqvist a and x always conflict miss … Conflict miss if the distans between the startaddress in memory of a and of x is a multiple of 1 k Words, 4096 Bytes. for(j = 0; j < 4; j++) x[i][j] = a[i][j] * c[i];

William Sandqvist a and x conflict miss 1:4 … for(j = 0; j < 4; j++) x[i][j] = a[i][j] * c[i]; Conflict miss 1:4 if the distans between the startaddress in memory of a and of x is a multiple of 1 k Words  3 Words, 4096 Bytes  12 Bytes.

William Sandqvist a and x no conflict miss … for(j = 0; j < 4; j++) x[i][j] = a[i][j] * c[i]; No conflict miss if the distans between the startaddresses in memory of a and of x is not a multiple of 1 k Words, and not a multiple of 1 k Words  3,  2,  1 Words!

William Sandqvist

8-1 Arbitration 3 Masters and 4 Slaves are connected to a classical bus. Read access pattern: M1M2M3 Rd S1Rd S2Rd S4 Rd S1Rd S3 Rd S2 Sequential execution, 7 cycles needed. 1. M1  Rd S1 2. M2  Rd S2 3. M3  Rd S4 4. M2  Rd S3 5. M3  Rd S3 6. M2  Rd S2 7. M1  Rd S1 Many other alternatives are possible!

William Sandqvist Slave side arbitration Weighted round robin slave-side arbitration. S1S2S3S4 M11--- M2-12- M3--11 Best case execution time (3 cycles) 1.M1  Rd S1 ; M2  Rd S2 ; M3  Rd S4 2.M1  Rd S1 ; M2  Rd S3 ; 3. ; M2  Rd S2 ; M3  Rd S3 Worst case execution time (4 cycles) 1.M1  Rd S1 ; M2  Rd S2 ; M3  Rd S4 2.M1  Rd S1 ; ; M3  Rd S3 3. ; M2  Rd S3 ; 4. ; M2  Rd S2 ; Connections and weights: M1M2M3 Rd S1Rd S2Rd S4 Rd S1Rd S3 Rd S2