Question: The second part of the laboratory task ( Section 3 c ) requires you to add the values extracted from the table together using 8
The second part of the laboratory task Section c requires you to add the values extracted
from the table together using bit arithmetic. If we assume a student number digit of then
the algorithm becomes:
The first part of the algorithm requires you to multiply the value of k by Whilst the AVR
does have a multiply Assembler instruction MUL what other operation can be performed to
multiply an bit unsigned integer by two?
The next part of the algorithm then requires the two values extracted from the lookup table
keyTable to be added together. Reviewing the values of keyTable shows that keyTable
x decimal and keyTablex decimal Adding these two hexadecimal
digits together results in xA decimal being assigned to keySum Note that in
Assembler C array table indices start at
For an bit computation, the maximum result that can be stored is xFF Beyond that,
we require the use of a carrybit. Based on the Assembler instructions, for a bit
computation Section g you will need to use an Add instruction followed by an Add with
Carry
As you develop your solution it is high recommended to write small pieces of test code that
assist in understanding how the instructions operate. Assembler can become complicated
quickly if you try to do everything at once. Remember that you can comment out sections of
code using a semicolon ;
Another important component of the l
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
