Assembly language?

Programming, for all ages and all languages.
Post Reply
nkeung
Posts: 1
Joined: Mon Jan 22, 2007 10:12 pm

Assembly language?

Post by nkeung »

Logically NAND 1234h with 7856h and give the 16-bit answer in binary.

how to do it? Can you explain?
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Re: Assembly language?

Post by Tyler »

nkeung wrote:Logically NAND 1234h with 7856h and give the 16-bit answer in binary.

how to do it? Can you explain?
1234H -> 0001001000110100
7856H -> 0111100001010110
AND -> 0001000000010100
NOT -> 1110111111101011

Each digit in a Hexedecimal number represents the 4 binary digits in the same place in the binary equivelent. So to turn a Hex value to Binary, convert each digit one by one and replace it with a 4 digit binary equivelant.

Then you simply Logically AND (Equals positive when both inp0uts are positive) and NOT (Opposite) the results.
Post Reply