Dcit 102 Assignment
Dcit 102 Assignment
66571(base8) =110110110101111001
= 1101111111010100 –1011111011101110+110110110101111001
= 10010001011000011 (base2)
We have to convert each number to binary then calculate their 1’s compliment then
compute the results
1011111011101110 = 0100000100010001
110110110101111001 = 001001001010000110
4. Comment on the two solutions; Q2 and Q3 and justify the results from both cases.
In Q2, the result was obtained by performing binary addition and subtraction directly and the
result was positive since the most significant bit was 0. For Q3, the results were obtained by
converting each number to its one’s compliment representation then performing binary
addition.
Justification:
Both solutions produced the same result which was also positive in both cases and this affirms
the validity of the calculations in both solutions.
5. Compute the value of 110111001101110(base2) – 111110100001101(base2) using 10s
compliment.
To find the 10s compliment, we first find the decimal form of these numbers.
110111001101110(base2) = 28270
111110100001101(base2) = 32026
= 28270 – 32026
= -3756
To deal with the negative, we use 10s compliment of the bigger number, 32026 which is
a 5-digit number and the biggest 5-digit number is 99999
Therefore;
= 99999 – 32026
=67973
We then add 67973 to 28270
= 67973 + 1
= 67974
Now we add 28270 to 67974
= 28270 + 67974
=96244
= 96244-100000 = -3756
Therefore, 28270 – 32026 = -37
6. Discuss the following number system codes with at least 2 practical applications in computing.
A. BCD
The BCD (Binary coded decimal) is used in representing each decimal digit with its
corresponding 4-bit binary equivalent.
Practical application:
B. Gray codes
This is a binary numeral system where two successive values differ in only one bit.
Practical applications:
b. The gray codes is also used in mechanical systems with position sensors, to help in
accurately reading the position.
C. Excess 3 codes
The excess 3 code is a binary coded decimal system where each decimal is represented
by its 4-bit binary value increased by 3
Practical applications:
a. The Excess 3 codes simplify the design of digital systems that perform arithmetic
operations of digital system
b. It is often used in educational setting to teach the principles of binary arithmetic and
code conversion.
D. Sequential codes
These are a sequence of codes where the code for each number is one greater than the
previous number.
Practical applications:
b. It is also used in pipeline processing within CPUs to ensure that instructions are
executed in the correct order
The Error correction codes are codes that enable the detection and correction of errors
within storage or data transmission.
Practical applications:
b. It is also implemented in optical storage media such as CDs to maintain data integrity.
F. Hamming codes.
These are a family of linear error correction codes that detect and correct single bit
errors.
Practical application:
a. It is employed in data transmission systems to detect and correct errors during data
transfer over unreliable connections
b. They are also used in Error correction code memory to detect and correct single bit
errors.
G. Reflective codes.
These codes are such that they are symmetrical with respect to a center value where
each number’s compliment is also a valid code.
Practical application:
H. 2421 codes
It is a weighted binary code used to represent decimal numbers where the weights are
2,4,2, and 1 respectively.
Practical application:
These codes, the Extended Binary Coded Decimal Interchange code and the American
Standard Code for Information Interchange, are character encoding codes.
Practical applications:
a. The EBCDID is primarily used in IBM mainframe and midrange systems for encoding
text data.
b. The ASCII is used in internet protocols to encode text-based data for
communication.