meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
automation:topics:bit_byte [2025/12/08 13:46] vamsanautomation:topics:bit_byte [2025/12/08 14:01] (current) vamsan
Line 12: Line 12:
  
 Therefore, the byte reaches its maximum value when all bits are set to 1. It can be calculated that **2#**11111111 = 255. The byte data type holds values between 0 and 255. Therefore, the byte reaches its maximum value when all bits are set to 1. It can be calculated that **2#**11111111 = 255. The byte data type holds values between 0 and 255.
 +
 +In computing, in addition to the base-10 number system, we also use the binary and base-16 number systems. The values ​​described in it are called hexadecimal numbers and are denoted by the prefix “**16#**” or sometimes “**hex#**”. Sometimes the hexadecimal number system is simply the hash, like this: “#ABCD”. The hexadecimal number system changes order of magnitude at 16, meaning that a position can contain a value between 0 and 15. This can be very confusing in the base 10 number system, so the two-digit positions are denoted by letters: \\ 
 + \\ 
 +10 = 16#A \\ 
 +11 = 16#B \\ 
 +12 = 16#C \\ 
 +13 = 16#D \\ 
 +14 = 16#E \\ 
 +15 = 16#F \\ 
 +
 +
 +If a byte reaches its maximum value, meaning every bit is set to “1”, then: **2#**11111111 = 255 = **16#**FF
 +
 +If we calculate: F, i.e., “15” * 16 + “15” = 255
 +
 +In some ways, this can make our lives easier, because if we see a value of “**16#**FF” somewhere, or a longer series of these, for example “**16#**FFFF_FFFF”, then we can suspect that we have reached the maximum value of one of the variable types.
 +I would also like to mention the 8-bit, i.e., octal number system, it sometimes still occurs here and there, for example, in the case of numerical symbols, but only rarely, we don’t really use it.
 +
 +
 +{{page>automation:topics:dead_beef}}