

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Instructions: All assignments must be typed; no hand-written assignments will be accepted. You must name your file as: your_last_name_your_first_name_HW# Acceptable file formats: .doc, .docx, .pdf Inside the file, you MUST include your full name, otherwise your HW will not be graded. Do not just give answer. You must show your work. Otherwise you will not get any points
This solution is prepared by TA Ms. Pei Liu
a) Convert 605 10 to binary, octal (base 8) and hexadecimal.
2 | |302- 1 |151- 0 |75 - 1 |37- 1 |18- 1 |9- 0 |4- 1 |2- 0 1 – 0
Binary answer = 1001011101 2 Octal answer = 001 001 011 101 2 = 1135 8 Hexadecimal answer = 0010 0101 1101 2 = 25D 16
b) Convert 10110011 2 to octal, decimal and hexadecimal. Decimal answer = 10110011 2 = 128+0+32+16+0+0+2+1=179 10 Octal answer = 010 110 011 2 =263 8 Hexadecimal answer = 1011 0011 2 =B3 16 c) Convert 21BA 16 to binary, octal and decimal. 216 =0010, 1 16 =0001, B 16 =1011, A 16 = Binary answer = 0010 0001 1011 1010 2 Decimal answer = 10000110111010 2 = 8634 10 Octal answer = 010 000 110 111 010 2 =20672 8
a) 10110101 + 00011001 = 11001110 (no overflow) 10110101
11001110 (no overflow as no 1 came out of most significant bit) b) 10010001 + 10111111 = 01010000 (overflow) 10010001
1 01010000 (overflow as 1 came out of most significant bit)
a) 01100001 + 00111111 = 10100000 (overflow) 01100001
10100000 (overflow: as 1 came into most significant bit but a 0 came out of most significant bit) [Adding two positive number gives negative result] b) 10111111 + 10010101 = 01010100 (overflow) 10111111
1 01010100 (overflow: as 0 came into most significant bit but a 1 came out of most significant bit) [Adding two negative number gives positive result] )
a) (305 - 4(53) + 7(2^4 )) mod 29 = 2 305 mod 29 = 453 mod29 = (4mod29 * 53mod29) mod29 = (4 * 24) mod29 = 7 2^4 mod29 = (7mod29 * 2^4 mod29) mod29 = 25 (305 - 4(53) + 7(2^4 )) mod 29 = (15-9+25)mod29 = 31mod29 = 2
b) 43 – (8 * 7)(9 - 7) mod 32 = 27 43mod 32 = 11 (87)(9-7)mod 32 = 562 mod 32 = 16 43 – (8 * 7)(9 - 7) mod 32 = (11 -16) mod 32 = (-5+32)mod 32 = 27