HW2DataRep

HW2DataRep - 12 - 9 Multiplication 6. Write out the work...

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

View Full Document Right Arrow Icon
CS 30 HW #2 - Binary representation Conversions: 1. Convert the decimal number 55 into: a) binary: b) hex: c) octal: 2 a) What decimal number does this unsigned binary number represent: 1111 1111 1111 1111 1111 1111 1011 1101 b) What decimal number does this two's complement binary number represent: 1111 1111 1111 1111 1111 1111 1011 1101 3 a) What is the range of decimal values stored by an 8-bit unsigned binary number? b) What is the range of decimal values stored by an 8-bit two's complement binary number? Addition / Subtraction 4. Solve the following 8-bit addition using binary. Indicate whether or not it experienced an overflow and a carry. 12 + 9 5. Solve the following 8-bit subtraction using binary. Indicate whether or not it experienced an overflow and a carry.
Background image of page 1

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

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

Unformatted text preview: 12 - 9 Multiplication 6. Write out the work for the following multiplication using binary. 7 * 5 Errors Given your new knowledge of binary representation and limited bit width, answer the following questions. 7. What happens when the result of an addition or subtraction does not fit into the number of bits provided? 8. What would happen if you executed the following code: Note: unsigned int means an integer being interpreted with unsigned numbers, as we learned at the beginning with binary. Java does not have such a type, but C does. void countdown(unsigned int x) { printf("Countdown: "); for(int i=x;i>=0;i++) printf("%d, ",i); printf(". ... Blastoff!"); }...
View Full Document

This note was uploaded on 12/27/2011 for the course CMPSC 30 taught by Professor Franklin during the Fall '09 term at UCSB.

Page1 / 2

HW2DataRep - 12 - 9 Multiplication 6. Write out the work...

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