can someone help me understand how to encode data using this diagram? so if the
ID: 2266540 • Letter: C
Question
can someone help me understand how to encode data using this diagram?
so if the instruction was
rjmp 0x57
how would this be encoded with the first diagram?
CONTROL TRANSFER INSTRUCTION ENCODING RELATIVE UNCONDITIONAL o rjmp Flash Program Memory 15 15 12 11 4 3 0 0 110n 15 0 PC CONDITIONAL 0x3FFF brbs s, k br 15 12 11 0 nkk alias brbc s, k brid brtc k brhc k brge k brvc k brpl k brne k brcc k SREG sss brbs s, k brie k to brts k 100 brlt k breq k bres k brsh k brlo k NOTES 1. See Register Direct Addressing for encoding of skip register bit set/clear instructions sbrc and sbrs 2. See I/O Direct Addressing for encoding of skip I/O register bit seticlear instructions sbis and sbic. 28 I PageExplanation / Answer
In the top diagram, bit 15-13 = 110 to represent unconditional control transfer instruction.
Bit 12 (shown in yellow color) is 0 = relative jump, 1= relative call.
Relative transfer means from current position of Program counter (PC) to specified index represented by bit 0-11 constant. Hence PC = PC + (12 bits K)
rjmp 0x57 = 1100000001010111
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.