return 0
return 0

Reputation: 4366

is 0x0F a 8 bit or 4 bit value?

if I have a port that has only 4 bits, but I am writing 0xFF & 0xF to it. What will happen? Will it truncate the most significant 4 bits or what?

Thanks.

Upvotes: 1

Views: 2387

Answers (1)

Mark Ransom
Mark Ransom

Reputation: 308392

Yes, that expression (masking with 0x0F) will take the bottom 4 bits from the value. Hopefully your port is connected to the 4 least significant bits of the bus - you'll need to consult the hardware documentation.

Upvotes: 1

Related Questions