-
Notifications
You must be signed in to change notification settings - Fork 0
/
hw_1.txt~
125 lines (79 loc) · 1.92 KB
/
hw_1.txt~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Homework #1
Excercise #1
1. hex 2AE3 into binary
= 0010 1010 0111 0011
2. binary 1101100111101 into hex
= 1B3D
3. decimal 246 into binary ★
= 1111 0110
246 is an even number that means the right most bit will be a '0'
255 in binary is 1111 1111 so we need nine less than that. Since we can get the sum of nine with 8 + 1 which are power of two's we need to just flip the bit at the respective locations.
4. decimal 613 into hex
in binary = 0010 0110 0101
in hex = 265
5. hex 2E03 into decimal
3 * (16^0) = 3
0 * (16^1) = 0
14 * (16^2) = 3584
2 * (16^3) = 8192
= 11779
Excercise #2
ccc cc
1. binary: 001011
+ 111011
---------
1000110
cc ccc
2. binary: 010111
+ 10110011
----------
11001010
ccc
3. hex: FFA32
+ 99DE1
-------
199813
ccc
4. hex: F111
+ FEFEFEFE
----------
FEFFF00F
Excercise #3
1. binary: 1X011 + 010Y1 = 100110
X = 1, Y = 1
2. hex: A2X + 7YF3 = 8622
X = F, Y = B
3. hex: FX621 + 12YFF = 10F120
X = C, Y = A
Excercise #4
1. 335 = 0000 0001 0100 1111
2. -3 = 0000 0000 0000 0011
One's complement = 1111 1111 1111 1100
Two's complement = 1111 1111 1111 1101
3. 0 = 0000 0000 0000 0000
4. -17 = 0000 0000 0001 0001
One's complement = 1111 1111 1110 1110
Two's complement = 1111 1111 1110 1111
5. -104 = 0000 0000 0110 1000
One's complement = 1111 1111 1001 0111
Two's complement = 1111 1111 1001 1000
Excercise #5
1. 761
761 = 47*16 + 9
47 = 2*16 + 15
2 = 0*16 + 2
= 2F9
2. -2 = 0002h
One's Complement = FFFD
Two's Complement = FFFE
3. -1,421 =
1421 = 88*16 + 13
88 = 5*16 + 8
5 = 0*16 + 5
= 58D
One's Complement = FA72
Two's Complement = FA73
Excercise #6
1. B34
2. 82F
3. 7BA