Workshop 01
Workshop 01
Workshop 01
Workshop 01
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
110001101 b
110010110 b
1011010 b* 1011b= 1111011110
1101000b + 2AB h + 345 q = ? h = ? q =3Deh=1736q
3AFh / 1Ch =? b = ?d =00100001b=
3ACh – 562q = ?b = ? d =001000111010b
3FFA h / 327q = ?b = ? d =01001100b
Exercise 4 (2 marks)
1- Show binary formats of 1-byte unsigned numbers: 251 , 163, 117
2- Show binary formats of 2-byte unsigned numbers: 551: 0000001000100111
, 160: 110100011, 443: 0000000110111011
3- Show binary formats of 1-byte signed numbers: -51: 1 00110011 , -163: 1
10100011, -117: 1 01110101, -20: 1 00010100
4- Show the decimal values of 1-byte unsigned representations: :
01100011 b , 10001111 b , 11001010 b , 01001100 b
01100011 b: 99 , 10001111 b: 143 , 11001010 b: 202 , 01001100 b: 76
Part 2: Explore memory structure of programs
Sample
Complete the code of following program then draw it’s memory structure
(2 marks)