Download hw1_sol

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Post-quantum cryptography wikipedia , lookup

Hardware random number generator wikipedia , lookup

Page replacement algorithm wikipedia , lookup

Transcript
HW1 ECE2060 Page 1 HW1 ECE2060 Au 2016 Lectures Covered: Lesson1 ‐ Lesson4 Show all relevant steps. Don’t just write down the answers. Late HWs will not be accepted. Lecture Students: turn in your HW in class. Recitation students: turn in your HW at the ECE Office Front Desk. HWs turned‐in anywhere else will not be accepted. Show your work on these pages, attach additional pages if necessary. • Be sure to organize the pages in order and staple them all together, otherwise you will lose one point • Fill out the following section. You will lose an additional point if you fail to provide these details Your Last Name_____________________________ Your First Name__________________________ 1. Lecture Student ____________ or Recitation Student__________ (check one) 2. If Recitation then fill out the following Name of recitation instruction______________________ Date/time of recitation______________ HW1 Page 1
HW1 ECE2060 Page 2 Problems start from next page. Each problem is worth 1 point. 1) The bits of (‐43)10 are to be placed in a 16 bit register (using 2's compliment representation). Show all the 16 bits in this register. 43
→ 0000,0000,0010,1011 → 1111,1111,1101,0101 43
2) The bits of (52)10 are to be placed in a 16 bit register (using 2's compliment representation). Show all the 16 bits in this register. 52
→ 0000,0000,0011,0100 3) Let a =(11000010)2 and b = (‐3)10, assume that we are using signed binary numbers (2's compliment representation) stored in 8 bit registers. Let c = a + b. i) Show all the binary bits of c ii) By using the argument based on "carry out of signed bit" and "carry into the signed bit" determine if there is overflow. 3
→ 0000,0011
3
→ 1111,1101 11000010 11111101 10111111 ∴
1 HW1 Page 2
HW1 ECE2060 Page 3 4) Let a =(11000010)2 and b = (‐3)10, assume that we are using signed binary numbers stored in 8 bit registers. Let c = a ‐ b. i. Show all the binary bits of c ii. By using the argument based on "carry out of signed bit" and "carry into the signed bit" determine if there is overflow. 11000010
1111,1101 11000010 00000011 11000101 ∴
0 5) Express (10000000)2 as a decimal number, i) If the above number is represented in 2's compliment representation ii) If the above number is represented in unsigned numbers representation i. ii. 1000,0000 1,1000,0000
0,1000,0000 128 2 ∴ 1000,0000 128 1000,0000
2
128 HW1 Page 3
HW1 ECE2060 Page 4 6) Express (37.625)10 as a binary number 37
→ 10,0101
. 625
1 ∗2
.625
0 ∗2
1 ∗2 → .101 37.625
→ 10,0101.101 HW1 Page 4
HW1 ECE2060 Page 5 7)
Express (63)10 as a Hexadecimal number 63
→ 0011,1111
0011 → 3 1111 →
63
→ 3
8)
The bits 11101000 are stored in an 8 bit register to represent a signed (2's compliment representation) binary number. This number is divided by 8 and stored in another 8 bit register. Show all the bits in this register. 11101000.
→ 11101.000 2
3
8 11111101 HW1 Page 5
1 HW1 ECE2060 Page 6 9)
The bits 11110100 are stored in an 8 bit register to represent a signed (2's compliment representation) binary number. This number is multiplied by 8 and stored in another 8 bit register. Show all the bits in this register. Use bit shifting for the multiplication by 8. 11110100.∗ 2 → 11110100000. 3
8 10100000 10) Express (789)10 as a BCD encoded number 789
7
→ 0111
8
→ 1000 9 → 1001 → 0111,1000,1001
HW1 Page 6