SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Linda Null ,julia Lobur
Chapter:
Data Representation In Computer Systems
Exercise:
Exercises
Question:25 | ISBN:9780763704445 | Edition: 3

Question

25. Assume a 24-bit word on a computer. In these 24 bits, we wish to represent the value 295.

a) If our computer uses even parity, how would the computer represent the decimal value 295?

b) If our computer uses 8-bit ASCII and even parity, how would the computer represent the string 295?

c) If our computer uses packed BCD, how would the computer represent the number +295?

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

a)

If our computer uses even parity and we want to represent the decimal value 295 in a 24-bit word, we first convert 295 to binary:

295 (decimal) = 100100111 (binary)

To include even parity, we need to add one additional parity bit to the 24-bit word to ensure an even number of 1s. The resulting representation would be:

Parity bit + Data bits: 1 00100111

 

b)

If our computer uses 8-bit ASCII and even parity, each character in the string "295" would be represented using 8 bits in ASCII encoding. Here is how each character would be represented:

"2" in ASCII: 00110010 "9" in ASCII: 00111001 "5" in ASCII: 00110101

Including even parity for each character, the representation of the string "295" would be:

Parity bit + ASCII bits: 1 00110010 0 00111001 0 00110101

 

c)

If our computer uses packed BCD (Binary Coded Decimal), each digit in the number +295 would be represented using 4 bits. The packed BCD representation of +295 would be:

+2: 0010 +9: 1001 +5: 0101

Therefore, the packed BCD representation of +295 would be: 0010 1001 0101

0 0

Discussions

Post the discussion to improve the above solution.