Quantity | Unit |
1024 B | 1 KB |
1024 KB | 1 MB |
1024 MB | 1 GB |
1024 GB | 1 TB |
725 B | 0.71 KB |
A byte can have a value from 0 to 255 total 256 values. As most computer processor works on 2 base calculation, bytes are calculated by base 2, Binary. As you know binary numbers charecter can be only 0 and 1 these are called bit. Computer processor calculates 1 as true or yes or circuit connected 0 as, false or no or circuit disconnected. So,
Decimal | Binary |
1 | 00000001 |
2 | 00000010 |
10 | 00001010 |
105 | 01101001 |
255 | 11111111 |
Did you noticed I have used 8 digits to express a binary number. Here is the reson of "By eight". A number between 0 to 255 is maximum 8 bit long in binary. So they are called "Byte". Now you have to know more advanced. If you go to working practically you will face a problem. You will find negetive byte value like -1 or -50. As I have told bytes can have values 0 to 255 that isn't incorrect in hexadecimal or binary but incorrect in decimal. Actualy byte values sequence is like this
0, 1, 2, 3, ... ... 126, 127, -128, -127, -126, ... ... -3, -2, -1
Here are 256 values.
Values | Total |
0 | 1 |
1 to 127 | 127 |
-128 to -1 | 128 |
All total: | 256 |
But in hexadecimal or binary these values are like
Decimal | Hexadecimal | Binary |
1 | 0x01 | 00000001 |
-1 | 0xFF | 11111111 |
73 | 0x49 | 01001001 |
-99 | 0x9D | 10011101 |
Now you can have a simple glimpse how bytes in file used. If you want to express a text charecter like "A" in a file there is a byte with value 65. Another charecter like "¤" contains two bytes 194 (-62) and 164 (-92). You can see more byte values of text charecter surfing the internet. Another usage in image files to express colors in RGB or ARGB. Now you know the basics of bytes. Everithing nowadays like video, text, image, sound can be express within bytes in a file concept.