07 - Lecture 07 - 19/12/2010 Computer Organization and...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Computer Organization and Architecture COMPUTER ARITHMETIC -2- Dr. Ersun İşçioğlu Eastern Mediterranean University, School of Computing and Technology, Department of IT e-mail: ersun.iscioglu@emu.edu.tr Signed Integer Representation b The conversions we have so far presented have involved only positive numbers (Revised for last lecture). b To represent negative values, computer systems allocate the high-order bit to indicate the sign of a value. s The high high-order bit order bit is the leftmost bit in a byte. s It is also called the most significant bit. b The remaining bits contain the value of the number. -2-
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Signed Integer Representation… b There are three ways in which signed binary numbers may be expressed: s Signed magnitude, s One’s complement and s Two’s complement. b In an 8-bit word, signed magnitude representation places the absolute value of the number in the 7 bits to the right of the sign bit. -3- Signed Integer Representation… b For example, in 8-bit signed magnitude, s positive 3 is: 00000011 s negative 3 is: 10000011 b Computers perform arithmetic operations on signed magnitude numbers in much the same way as humans carry out pencil and paper arithmetic. s Humans often ignore the signs of the operands while performing a calculation, applying the appropriate sign after the calculation is complete. -4-
Background image of page 2
3 Signed Integer Representation… b Binary addition is as easy as it gets. You need to know only four rules: s 0 + 0 = 0 0 + 1 = 1 s 1 + 0 = 1 1 + 1 = 10 b The simplicity of this system makes it possible for digital circuits to carry out arithmetic operations. s We will describe these circuits in next lecture. s Let’s see how the addition rules work with signed magnitude numbers . . . -5- Signed Integer Representation… b Example: s Using signed magnitude binary arithmetic, find the sum of 75 and 46. b First, convert 75 and 46 to binary, and arrange as a sum, but separate the (positive) sign bits from the magnitude bits. -6-
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Signed Integer Representation… b Example: s Using signed magnitude binary arithmetic, find the sum of 75 and 46. b Just as in decimal arithmetic, we find the sum starting with the rightmost bit and work left. -7- Signed Integer Representation… b Example: s Using signed magnitude binary arithmetic, find the sum of 75 and 46. b In the second bit, we have a carry, so we note it above the third bit. -8-
Background image of page 4
5 Signed Integer Representation… b Example: s Using signed magnitude binary arithmetic, find the sum of 75 and 46. b The third and fourth bits also give us carries. -9- Signed Integer Representation… b Example: s Using signed magnitude binary arithmetic, find the sum of 75 and 46. b Once we have worked our way through all eight bits, we are done. -10- In this example, we were carefully pick two values whose sum would fit into seven bits.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

07 - Lecture 07 - 19/12/2010 Computer Organization and...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online