Let's take an example -- how would we encode the number 35? Converting 3510 to binary, we get 100101. (Double check that before reading on).
That is all there is to it -- we encode the number 35 as bits 100101.
If the number 35 were stored in a byte of memory, that byte would contain these 8 bits: 00100101.
We have been speaking of integral numbers. Floating point numbers -- those with decimal points -- are typically encoded as two binary numbers, one representing the value and the other the location of the decimal point, but we will leave the details for another time.
Resources