Recitation3: CS 3843 Computer Organization 4th week

Slides:



Advertisements
Similar presentations
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.
Advertisements

Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Sample Test 1 Question. A pattern of binary digits can be interpreted in several different ways. Show how the pattern translates using each of.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Floating Point Numbers
Number System and Codes
Two’s Complement 1.As an action: (Assume the starting value is 1011) 1.Flip the bits from the starting value => Add one to get the answer.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
Binary Number Systems.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
Computer Organization & Programming Chapter2 Number Representation and Logic Operations.
Simple Data Type Representation and conversion of numbers
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Number Systems So far we have studied the following integer number systems in computer Unsigned numbers Sign/magnitude numbers Two’s complement numbers.
Computer Architecture
CSC 221 Computer Organization and Assembly Language
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
Integer & Floating Point Representations CDA 3101 Discussion Session 05.
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
CS 101 – Aug. 31 Interpreting binary  decimal √ Decimal  binary Shorthand ways of expressing binary –Octal –“Hex” Negative numbers.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
CEC 220 Digital Circuit Design Binary Codes
IT1004: Data Representation and Organization Negative number representation.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
Learning Objectives 3.3.1f - Describe the nature and uses of floating point form 3.3.1h - Convert a real number to floating point form Learn how to normalise.
COSC2410: LAB 2 BINARY ARITHMETIC SIGNED NUMBERS FLOATING POINT REPRESENTATION BOOLEAN ALGEBRA 1.
FLOATING-POINT NUMBER REPRESENTATION
Floating Point Numbers
Floating Point Numbers
Floating Point Representations
Lecture 6. Fixed and Floating Point Numbers
Data Representation Covering… Binary addition / subtraction
Design of Digital Circuits Reading: Binary Numbers
David Kauchak CS 52 – Spring 2017
A brief comparison of integer and double representation
Chapter 4 Operations on Bits.
Introduction To Computer Science
Floating Point Representations
Dr. Clincy Professor of CS
Data Representation Binary Numbers Binary Addition
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Computer Science 210 Computer Organization
Floating Point Number system corresponding to the decimal notation
Data Representation Integers
EPSII 59:006 Spring 2004.
CSE 102 Introduction to Computer Engineering
Exercise: Add these two single precision IEEE 754 numbers: … …0 Left number: 1.101x24 Right number: 1.011x 22= x24.
Addition and Substraction
CS1010 Programming Methodology
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 6
Recitation2: CS 3843 Computer Organization Second week
Topic 3d Representation of Real Numbers
Computer Science 210 Computer Organization
Number Representations
Number Systems Base 2, 10, 16.
Data Representation Data Types Complements Fixed Point Representation
Data Representation in Computer Systems
CS 101 – Sept. 4 Number representation Integer Unsigned √ Signed √
CPS120: Introduction to Computer Science
Chapter 6: Computer Arithmetic
Numbers representations
COMS 161 Introduction to Computing
Chapter3 Fixed Point Representation
Number Representations
Presentation transcript:

Recitation3: CS 3843 Computer Organization 4th week Instructor: Dr. Vijayalakshmi Saravanan TA: Tianyi Liu

Recitation3: 7problems 1. Perform the following addition in base 8 without converting to another base. You must show the carries. Do not use a calculator, but you may use your fingers.

Recitation3: 7problems 2. Assume that x, y, and z are unsigned 10-bit integers. Suppose x = 784 and y = 423. Find the value of z if: 1) z = x + y; 2) z = x - y; 3) z = y - x; 4) z = x*y; 5) z = x/y; Unsigned 10-bit integer means there are 1024 integer numbers (0-1023). 784 + 423 = 1207. z = 1207 (mod 1024) = 183. 784 - 423 = 361, which fits in 10 bits, so z = 361. 423 - 784 = -361 which has the same 10-bit representation as 1024 - 361, so z = 1024 - 361 = 663. 784 * 423 = 331,632. z = 331,632 (mod 1024) = 880. 5. 784/423 = 1.

Recitation3: 7 problems 3. Assume that x, y, and z are two's complement 10-bit integers. Suppose x = 498 and y = 423. Find the value of z if: 1) z = x + y; 2) z = x - y; 3) z = y - x; 4) z = x*y; 5) z = x/y; First, we should know the range of 10-bit integers. That is -512 to +511. z = x+y = 498+423 = 511 + 410 that is -(513-410) = -103 z = x-y = 498-423 = 75 z = y-x = 423-498 = -75 z = x*y = 498*423= 210,654(mod 1024)=734 z = x/y = 498/423 = 1

Recitation3: 7 problems 2) convert 765 into sum of 2n 4. Use shifting, adding and subtracting to show how you would multiply an unsigned x by: 1) 37 2) 765 (do not use more than 3 shifts) 3) 503 (do not use more than 2 shifts) 765 = 512 + 256 -2 -1 = 29 + 28-21-20= (x<<9) + (x << 8) – (x<<1) -x 1) convert 37 into sum of 2n 3) convert 503 into sum of 2n 37 = 25 + 22 + 1 503 = 512 - 8 -1= 29 -23-20 (x<<5) + (x << 2) + x (x<<9) + (x << 3) – x

Recitation3: 7 problems First, convert 57 into IEEE format 5. For the IEEE single precision floating point representation (32 bits) what is the representation of the number 57? Show your answer in binary in the form: x xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx and also as 8 hexadecimal digits. 57 = [111001] = (1.11001)b* 25 s=0, E = 5 and exp = 5 + 127 = 132 = [10000100] and frac = 1100100...000. Second, the answer is: The answer is 0 10000100 11001000000000000000000 = 0100 0010 0110 0100 0000 0000 0000 0000 = (42640000)16.

Recitation3: 7 problems First, convert -253.25 into IEEE format 6. For the IEEE single precision floating point representation (32 bits) what is the representation of the number -253.25? Show your answer in binary in the form: x xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx and also as 8 hexadecimal digits. 253.25 = (11111101.01)b = (1.111110101)b * 27 Since -253.25 is negative, s = 1, E = 7 and exp = 7 + 127 = 134 = [10000110] and frac = 1111101010000...000. Second, the answer is: The answer is 1 10000110 11111010100000000000000 = 1100 0011 0111 1101 0100 0000 0000 0000 = (c37d4000)16.

Recitation3: 7 problems EXP=[1001 1111]= 159 E = 159-127 = 32 s = 0 Frac=. 100 0011 1101 0000 0000 0000 M = 1. 100 0011 1101 0000 0000 0000 So, V = (1. 100 0011 1101 0000 0000 0000)b * 232 = 1100 0011 1101 0000 0000 0000 0000 0000 7. For the IEEE single precision floating point representation (32 bits) what number os represented by the bit pattern corresponding to: 0x4fc3d000? First, convert 0x4fc3d000 into binary 0x4fc3d000= 0100 1111 1100 0011 1101 0000 00000 0000 Third, convert IEEE format into decimal (1100 0011 1101 0000 0000 0000 0000 0000)b = 0x187a0 0000 = 6,570,377,216 Second, convert binary into IEEE format 0 1001 1111 100 0011 1101 0000 00000 0000