byte, word and double-word number representation

1.1k views Asked by At

I read a book which called assembly64 and can be found here, now it says that - A byte (8-bits) can be used to represent 256 different numbers, a word (16-bits) can be used to represent 65,536 different values, and a double-word (32-bits) can be used to represent 4,294,967,296 different numbers. So, if you wanted to store a value of 100,000 then a double-word would be required.

I don't under what does represent x different values mean? I know that a character is 1 byte and 256 is intended to be the ASCII table, but I didn't understand the following line - a word (16-bits) can be used to represent 65,536 different values, what's is the 65,536 values mean?

2

There are 2 answers

0
AudioBubble On

I don't understand what "represent x different values" means.

If you have a data type that can store the values 0 and 1, it can store two different values.

Thus, "represents x different values" means that, if you start from 0, it can store integers up to x - 1. That said, numbers are often signed, so the maximum is lower and the minimum is negative.

To find the maximum unsigned value given the number of bits, the calculation is 2^n - 1 if n is the number of bits.

On page 36 of the document you linked (direct link), there's a table that details the possible values that can be stored in each data type, signed and unsigned.

0
vmemmap On

The same thing goes to any of the datatypes you mention - A byte is a group of 8 bits. A bit is the most basic unit and can be either 1 or 0. A byte is not just 8 values between 0 and 1, but 256 different combinations (rather permutations) ranging from 00000000 via e.g. 01010101 to 11111111 . Thus, one byte can represent a decimal number between 0(00) and 255.