HW2_sol

# HW2_sol - CS 30 HW#2 Binary representation Conversions 1 Convert the decimal number 55 into a binary 0b110111 b hex 0x37 c octal 0o67 2 a What

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

HW #2 - Binary representation Conversions: 1. Convert the decimal number 55 into: a) binary: 0b110111 b) hex: 0x37 c) octal: 0o67 2 a) What decimal number does this unsigned binary number represent: 1111 1111 1111 1111 1111 1111 1011 1101 0xffffffbd (it's easier for me if I go to hex first) 4,294,967,229 b) What decimal number does this two's complement binary number represent: 1111 1111 1111 1111 1111 1111 1011 1101 1000011 -> 1+2+64 -> -67 3 a) What is the range of decimal values stored by an 8-bit unsigned binary number? 0 -> 2^8-1 b) What is the range of decimal values stored by an 8-bit two's complement binary number? -2^7 -> 2^7-1 Addition / Subtraction 4. Solve the following 8-bit addition using binary. Indicate whether or not it experienced an overflow and a carry. 12 + 9 00001100 + 00001001 __________ 00010101 No overflow, no carry 5. Solve the following 8-bit subtraction using binary. Indicate whether or not it experienced an overflow and a carry. 12 - 9

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

View Full Document
This is the end of the preview. Sign up to access the rest of the 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

HW2_sol - CS 30 HW#2 Binary representation Conversions 1 Convert the decimal number 55 into a binary 0b110111 b hex 0x37 c octal 0o67 2 a What

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

View Full Document
Ask a homework question - tutors are online