Question: you are required to write a program for a communication transmitter module to generate EVEN parity for 100 byte-wide data value stored in SRAM locations
you are required to write a program for a communication transmitter module to generate EVEN parity for 100 byte-wide data value stored in SRAM locations starting at address 0X100. Assume data is sent as an 8-bit packet (7-bit data +1-bit parity). Parity bit is MSB. After parity bit is generated, data values are stored in locations starting at address 0X200.
Using AVR assembly address, write a subroutine called PARITY_GEN by following the steps ( for each data byte value) in the algorithm given below. You must use a loop and access data using indirect addressing mode with post-increment operator.
Aalgorithm : 1- load data byte value from source location. 2- Clear the parity bit (MSB). 3- Count the number of 1's in the data value. 4- If the number of 1's is ODD, then set the parity bit high. Otherwise, leave the parity bit low. 5- Store the data value with parity in target location. Hint: use X and Y register to point to the source location and target location.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
