learn.dev42.co.uk

Binery

Print Hello World

Binery to Hex

8 bit Binery can be split into 4 bit(Nibble) chunks then converted in to hex. working from right to left
00101011 would be split into 0010 1011 which is then converted using hex into 3 B or 3RD and 11TH Hex number.
1011101 would be split into 101 1101 as you work from right to left. the hex for that would be 5 D

Binery to Denery

With binery you Always work from right to left so from the right your first Binery number represents 1 then doubles every next value. A 4 bit number would represent 8 4 2 1 so 1010 would be 8 + 2 = 10 or 1100 would be 8 + 4 = 12

Hex to Denery

best way to do this is to go from Hex to Binery then fromm Binery to Denery

Binery Shift

this is used for doubling or halfing the value. Use a binery left shift to double the number or a binery right shift to half it.
using a binery left shift 11001010 would become 110010100 which is double 202 to make 404
using a binery righ shift 11001010 would become 1100101 which is half of 202 to make 101
if you right shift a binery number with an odd number then the number would be rounded down by one.
10110101 would round down 1011010 which is from 181 to become 90. it is slightly inacreut as you have lost the last bit causing the number to lose a value

Unsigned fixed-point binery

unsigned meanes that it is a “Normal” binery number. from right to left th value doubles from 1. fixed point means that after “X” bits there will be a decimal point. still working from the left.
using this 10110101 with 3 points after the decimal point would be 10110.101 any numbers before the decimal point represent normal binery numbers from 1 doubeling to the right.
after the decimal point they count from 1/2 and halfs onwards. counting 1/2, 1/4, 1/8, 1/16 and so on.

so the .101 would represent 1/2 + 1/8 = 5/8 or 0.625
then the 10110. would be 2 + 4 + 16 = 22
therefor 10110101 with 3 points after the decimal place would be 22.625