In the instruction “MOV TH1,#-3”, what is the value that is being loaded in the TH1 register?

In the instruction “MOV TH1,#-3”, what is the value that is being loaded in the TH1 register?
A. 0xFCH
B. 0xFBH
C. 0xFDH
D. 0xFEH
 
Answer: c
Explanation: Negative value is loaded in 2’s complement form. -3 represented in 2’s complement form as FDH.
Steps to convert into 2’s complement:
Code:
3 → 0000 0011       	Binary Equivalent of ‘3’
  →  1111 1100          1’s Complement of decimal ‘-3’
  →  1111 1101       	2’s Complement of decimal ‘-3’
      F     D           Hex Equivalent of ‘-3’
 

Tìm kiếm

Back
Top