When discussing about the endian, the instructor gave us a word 0A0B0C0D in hexadecimal, and why would it be a 32-bit word?
Thanks.
When discussing about the endian, the instructor gave us a word 0A0B0C0D in hexadecimal, and why would it be a 32-bit word?
Thanks.
Preamble:
What would the answer have been had your instructor given 000000000A0B0C0Dh ?
Well, the answers provided by @ergonaut and @kdbanman would yield 64-bits.
Your question:
why would it be a 32-bit word?
The value your instructor gave does not necessarily have to be just 32-bit. It could easily be considerd 64-bit, 128-bit, or anything else starting at 28-bit for that matter.
What is important here is the position of the most significant digit.
To find out translate the hexadecimal value 0A0B0C0Dh into its binary equivalent 0000'1010'0000'1011'0000'1100'0000'1101b and note that the 1 that is most to the left occupies the 28th position. Remember bit numbering starts from the right!
Now since 28 bits clearly won't fit in a 16-bit word, we choose the next higher format which is 32-bit.
Applying this logic to the value in my preamble will also lead to a 32-bit number which is the correct answer. When classifying numbers we don't consider any leading zeroes!
0A0B0C0D is 0000/1010/0000/1011/0000/1100/0000/1101 in binary because each hexadecimal is represented by a 4 bits. So if you count them all, you get 32-bits in total.
There are 8 hex digits, each hex digit is 4 bits, 8*4 = 32 bits.
Your particular word looks like this:
0000 1010 0000 1011 0000 1100 0000 1101
0 A 0 B 0 C 0 D