Skip to content

File Name: 4_and_8_bits.py ```python

import data_types.commonUtils as utils

from stylepy import h1, h2, h3, h4, h5, h6

h1('4 and 5 Bit Basics')

h2('4 Bits') h4('Note: 4 bits can represent numbers from 0 to 15 (2^4 - 1).') h4(''' | Decimal | Binary | |---------|--------| | 0 | 0000 | | 1 | 0001 | | 2 | 0010 | | 3 | 0011 | | 4 | 0100 | | 5 | 0101 | | 6 | 0110 | | 7 | 0111 | | 8 | 1000 | | 9 | 1001 | | 10 | 1010 | ''')

h2('8 Bits') h4('Note: 8 bits can represent numbers from 0 to 255 (2^8 - 1).') h4(''' | Decimal | Binary | |---------|-----------| | 0 | 00000000 | | 1 | 00000001 | | 2 | 00000010 | | 3 | 00000011 | | 4 | 00000100 | | 5 | 00000101 | | 6 | 00000110 | | 7 | 00000111 | | 8 | 00001000 | | 9 | 00001001 | | 10 | 00001010 | ''')```