Question: An important technique for detecting errors in data transmission is the concept of a parity bit. In this question, you will write a program to

An important technique for detecting errors in data transmission is the concept of a parity bit. In this question, you will write a program to compute the (even) parity bit for a 16-bit data value. This parity bit (which is either 0 or 1) is computed so that the number of bits that is 1 in the data value along with the parity bit is even.
Write an LC-3 program that will read in a 16-bit hexadecimal value from the memory location DATA. It will then print out to the console the even parity bit value, which is the 1 or 0 bit that would need to be appended to the value in order to make the total number of one bits in the 16 bit input is even.
For example, if the 16 bits in question is 1001101010111100(or x9ABC Hexadecimal). This input has 9 one bits, and since 9 is odd, the parity bit would be 1. If the input was 1010101111001101(or xABCD Hexadecimal), then the input has 10 one bits (which is even) and therefore the parity bit would be 0.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!