270L04Notes - EECS 270 Fall 2009 Lecture 4 of 8 x y z Page...

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

View Full Document Right Arrow Icon
x y z EECS 270, Fall 2009, Lecture 4 Page 1 of 8 Class status Group assignment 1 due today at 2pm. It will likely be picked up at 2pm sharp. Individual homework 2 is posted and is due next week Monday. Inlab 1 and prelab 2 are due at the start of lab this week. Lab 2 is all about delay… I. Representing negative numbers in binary (p194-197) When we represent negative numbers in decimal we use an additional symbol, the minus sign “–“, to indicate that the number is negative. When using a computer we only have ones and zeros, so we can’t use some extra character to indicate that the number is negative. One trick we could play is to have one of the bits of the number indicate sign. Signed-magnitude representation One scheme you could use is just to have one of the bits in the number be the sign bit. Say if the leftmost bit (i.e. the most significant bit) is a one the rest of the number is negative and if it’s zero then the number is positive. So 1100 is -4 while 0100 is 4. How would we write -6? ___________ . 6? _____________ In a computer or other digital device we generally have a fixed number of bits per number. Say we are using 4-bit numbers. What is the smallest number we can represent? _______ The largest? For an n-bit number using signed magnitude representation, what is the range of representation? _________ How many different values can we represent with n-bits? _______________ This scheme has any number of downsides. The most obvious is that building an equals comparator is a bit tricky. Why? Another issue is that building an adder which can add two signed-magnitude numbers is a bit tricky… 2’s complement representation The scheme that is most commonly used to represent negative numbers in a computer is called “2’s complement”. The text goes into a good degree of background about the name and why it works. But the basic idea is that we treat the most significant bit as being negative but of the same magnitude it would be
Background image of page 1

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

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

This note was uploaded on 04/18/2011 for the course EECS 270 taught by Professor David during the Spring '11 term at Michigan State University.

Page1 / 8

270L04Notes - EECS 270 Fall 2009 Lecture 4 of 8 x y z Page...

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

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