Bit count


In task 11. The Man Behind the Bit Mask you ask to check bit4.
usually bits are counted from '0' so that
bit0 = 0b1
bit1 = 0b10
bit2 = 0b100
bit3 = 0b1000
bit4 = 0b10000
bit5 = 0b100000

maybe you may rename that task?


I think your understand of bits is a little off.

Do this

for i in range(20):


I only mean the caption, the variable name. In all technical documentation for instance in byte there are 8 bits starting from LSB to MSB, and they are named BIT0, BIT1,BIT2,...,BIT7. So the first bit is BIT0, second is BIT1 and the last one (in byte), eighth is BIT7. And the bitmask for this byte is defined as [7:0] and not [8:1]. I'm not talking about their values in decimal.