Computer Organization: Self-Modifying Codes and Number Systems - Prof. Sukumar Ghosh, Assignments of Computer Architecture and Organization

Solutions to select exercises from the computer organization course, covering topics such as self-modifying codes, dealing with their challenges, and debugging. Additionally, it includes exercises on binary and decimal number systems, applying hamming code, and ieee 754 format.

Typology: Assignments

Pre 2010

Uploaded on 03/19/2009

koofers-user-4b1
koofers-user-4b1 🇺🇸

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
22C:060 Computer Organization
Sample solution to Assignment 1
(Chapter 1, Exercise 10) Dealing with self-modifying codes is challenging. Debugging
can be a nightmare. Codes can be accidentally corrupted too. Security holes are a matter
of concern and may be easy to plant. On the other hand, self-modifying codes can
provide new opportunities to write innovative codes. (In the early days, they were used to
simulate indexed addressing)
(Chapter 2, Exercise 2(c)) 652 10 = 1621 7
(Chapter 2, Exercise 4(b)) 57.55 10 = 111001.100011 2
(Chapter 2, Exercise 6(c))
Binary
Decimal
Binary
Decimal
000
001
010
011
+0
+1
+2
+3
100
101
110
111
-4
-3
-2
-1
(* Some of you did not understand the meaning of 3-bit word.)
(Chapter 2, Exercise 34(b))
Original integer 10011001110
After applying Hamming code 1 0 0 1 1 0 1 0 1 1 1 0 0 0
There are four parity bits in positions 1, 2, 4, 8. Their values are chosen so that the even
parity is maintained for the following bit combinations:
(8,9,10,11,12,13,14) (4,5,6,7,12,13,14) (2,3,6,7,10,11,14) (1,3,5,7,9,11,13)
Problem 6-7
(a) –11.625 IEEE 754 format 1 10000010 011101 ….0 (23bits)
(b) + 0.15625 IEEE 754 format 0 01111100 010000 … 0 (23 bits)

Partial preview of the text

Download Computer Organization: Self-Modifying Codes and Number Systems - Prof. Sukumar Ghosh and more Assignments Computer Architecture and Organization in PDF only on Docsity!

22C:060 Computer Organization

Sample solution to Assignment 1

(Chapter 1, Exercise 10) Dealing with self-modifying codes is challenging. Debugging can be a nightmare. Codes can be accidentally corrupted too. Security holes are a matter of concern and may be easy to plant. On the other hand, self-modifying codes can provide new opportunities to write innovative codes. (In the early days, they were used to simulate indexed addressing)

(Chapter 2, Exercise 2(c)) 652 10 = 1621 (^7) (Chapter 2, Exercise 4(b)) 57.55 10 = 111001.100011 (^2) (Chapter 2, Exercise 6(c)) Binary Decimal Binary Decimal 000 001 010 011

(* Some of you did not understand the meaning of 3-bit word.)

(Chapter 2, Exercise 34(b)) Original integer 10011001110

After applying Hamming code 1 0 0 1 1 0 1 0 1 1 1 0 0 0

There are four parity bits in positions 1, 2, 4, 8. Their values are chosen so that the even parity is maintained for the following bit combinations: (8,9,10,11,12,13,14) (4,5,6,7,12,13,14) (2,3,6,7,10,11,14) (1,3,5,7,9,11,13)

Problem 6- (a) –11.625 IEEE 754 format 1 10000010 011101 ….0 (23bits) (b) + 0.15625 IEEE 754 format 0 01111100 010000 … 0 (23 bits)