hw4sol - CSCI 120 Introduction to Computation Homework 4...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: CSCI 120 Introduction to Computation Homework 4 Solution Saad Mneimneh Visiting Professor Hunter College of CUNY PART 1: Binary System (a) Find the decimal representation of each of the following bytes: 01010111 01101000 01100001 01110100 00100000 01100100 01101111 01100101 01110011 00100000 01101001 01110100 00100000 01110011 01100001 01111001 00111111 ANSWER : See below. (b) Assuming the above message is encoded in ASCII, what does it say? (you may search the Internet for ASCII code). 87 104 97 116 32 100 111 101 115 32 105 116 32 115 97 121 63 W h a t d o e s i t s a y ? (c) Convert each of the following numbers to binary using either the coin algo- rithm or the repeated division algorithm: 7 11 16 15 33 ANSWERS : (a) 7/2=3 and r=1. 3/2=1 and r=1. 1/2= and r=1. (stop) Therefore, 7 is 111. (b) 11/2=5 and r=1. 5/2=2 and r=1. 2/2=1 and r=0. 1/2= and r=1. (stop) Therefore, 11 is 1011. (c) 16/2=8 and r=0. 8/2=4 and r=0....
View Full Document

Page1 / 4

hw4sol - CSCI 120 Introduction to Computation Homework 4...

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

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