0% found this document useful (0 votes)
55 views

Excersise 2

This document contains the contents and strategy for a 10 minute lecture. It includes 27 exercises involving binary, decimal, and hexadecimal conversions as well as signed and unsigned number representations. Example problems include converting between number bases, adding and subtracting in different bases, one's and two's complement, and storing character strings in memory using ASCII encoding.

Uploaded by

Alynn Evans
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Excersise 2

This document contains the contents and strategy for a 10 minute lecture. It includes 27 exercises involving binary, decimal, and hexadecimal conversions as well as signed and unsigned number representations. Example problems include converting between number bases, adding and subtracting in different bases, one's and two's complement, and storing character strings in memory using ASCII encoding.

Uploaded by

Alynn Evans
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Time Lecture

Plan Contents of Lecture Strategy


(min) (Remarks)

10 Exercise:
mins
1. Convert 82ADh to decimal.
Ans: 35373d

2. Convert 11101b to decimal.


Ans: 29d

3. Convert 2BD4h to decimal.


Ans: 11220d

4. Convert 95 to binary.
Ans: 1011111b

5. Convert 2B3Ch to binary.


Ans: 0010101100111100b

6. Convert 1110101010b to hex.


Ans: 3AAh

7. Add 3546d and 1872d.


Ans: 5418d / 3CF61h

8. Add 5B39h and 7AF4h.


Ans: D62Dh

9. Add 100101111b and 110110.


Ans: 101100101b

10. Subtract 7283d from 9145d.


Ans: 1862d

11. Subtract BA94h from D26Fh.


Ans: 17DBh

12. Subtract 0111b from 1001.


Ans: 10b
13. Find one’s compliment of 5.
Ans: 11111010b
Time Lecture
Plan Contents of Lecture Strategy
(min) (Remarks)

10 14. Find two’s compliment of 5.


mins Ans: 11111011b
15. Find two’s compliment of the two’s compliment of 5.
Ans: 101b
16. Suppose AX contains 5ABCh and BX contains 21FCh. Find the difference of
AX minus BX by using complementation and addition.
Ans: 10011100011000000b=38C0h
17. Suppose AX contains FE0Ch. Give the unsigned and signed decimal
interpretations.
Ans: signed=500
Unsigned=65036

18. Show how the character string “RG 2z” is stored in memory, starting at
address 0.
Ans:
Address Contents of Bytes
0 01010010
1 01000111
2 00100000
3 00110010
4 01111010

19. In many applications, it saves time to memorize the conversions among small
binary, decimal, and hex numbers. Fill in the blanks in the following table:

Binary Decimal Hex


1001b 9 9h
1010b 10 Ah
1101b 13 Dh
1100b 12 Ch
1110b 14 Eh
1011b 11 Bh

20. Convert the following binary and hex numbers to decimal:

a. 1110b=14d
b. 100101011101b=2397d
c. 46Ah=1130d
d. FAE2Ch=1027628d

Lesson 2 -2- Computer Organization and Assembly Language (CS-530)


Time Lecture
Plan Contents of Lecture Strategy
(min) (Remarks)

10 21. Give the unsigned and signed decimal interpretations of each of the following 16-
mins bit or 8 bit numbers.
Signed unsigned
a. 7FFEh 32766d 32766d
b. 8543h 34115d -31421d
c. FEh -2d -254d
d. 7Fh 7d 7d

22. Show how the decimal integer -120 would be represented


a. In 16 bits=1111111110001000b
b. In 8 bits=10001000b

23. For each of the following decimal numbers, tell whether it could be stored (a) as a
16-bit number (b) as an 8-bit number.
a. 32767=16 bit
b. -40000= out of range
c. 65536= out of range
d. 257= 16 bit
e. -128= 8 bit

24. For each of the following 16-bit signed numbers, tell whether it is positive or
negative.
a. 1010010010010100b=negative
b. 78E3h=positive
c. CB33h=negative
d. 807Fh=negative
e. 9AC4h=negative

25. If the character string “$12.75” is being stored in memory starting at address 0,
give the hex contents of bytes 0-5.
Ans:
Address Contents of Bytes
0 00100100
1 00110001
2 00110010
3 00101110
4 00110111
5 00110101

26. Translate the following secret message, which has been encoded in ASCII as 41
74 74 61 63 6B 20 44 61 77 6E.
Ans: Attack Dawn.

Lesson 2 -3- Computer Organization and Assembly Language (CS-530)


Time Lecture
Plan Contents of Lecture Strategy
(min) (Remarks)

27. Suppose that a byte contains the ASCII code of an uppercase letter. What hex
number should be added to it to convert it to lower case?
Ans: 20h

28. Suppose that a byte contains the ASCII code of a decimal digit; that is, “0” . . .
“9”. What hex number should be subtracted from the byte to convert it to the
numerical form of the characters?
Ans: 30h

Lesson 2 -4- Computer Organization and Assembly Language (CS-530)

You might also like