PFC Workshop 01 Co Dap An
PFC Workshop 01 Co Dap An
Workshop 01
SE162141 – Phạm Thành Sang
Objectives:
(1) Reviewing for number systems
(2) Exploring memory of a C program
Recommendations
Part 1: Students do exercises using notebooks
Part 2: Students develop programs, run them, write down their memory structure to
notebooks.
Exercise 2(2 marks): Convert decimal numbers to binary and hexadecimal ones
101101111 b
+ 100111011 b
110110001 b
110001101b
0101 1110 1000b
Exercise 4 (2 marks)
1- Show binary formats of 1-byte unsigned numbers: 251 , 163, 117
251: 1111 1011b
163: 1010 0011b
117: 0111 0101b
2- Show binary formats of 2-byte unsigned numbers: 551 , 160, 443
551: 0000 0010 0010 0111b
160: 0000 0000 1010 0000b
443: 0000 0001 1011 1011b
3- Show binary formats of 1-byte signed numbers: -51 , -163, -117, 320
-51: 1100 1101b
-163: 0101 1101b
-117: 1000 1011b
320: overflow 1 byte (320>255)
4- Show the decimal values of 1-byte unsigned representations: :
01100011 b , 10001111 b , 11001010 b , 01001100 b
0110 0011b : 99d
1000 1111b : 143d
1100 1010b : overflow :”
0100 1100b : 76d
c:22936 ‘A’
23
i:22936 1
16
l:2293 1000
612
f:22936 0.5
08
d:22936 12.809
00
Complete the code of following program then draw it’s memory structure
(2 marks)
ANSWER: