| category : | networking |
|---|---|
| version : | |
| topic : | calculations |
Step 1
Start by writing down the necessary parts of the 12-bit diagram from memory on a piece of paper.
Convert the decimal value 13 to binary format.
The 12-bit diagram have all its bits switched OFF. However it shows pre-calculated base 2 binary values converted to base 10 decimal values, when all the 12 bits are switched ON. Look at the table from the Intro chapter to double check everything.
Start calculating by looking at the 12-bit diagram and scribble down numbers as you go. The 12-bit diagram is
calculated from right to left ← that's something very important to remember!
But I've already done that for you by writing down the numbers highlighted with a green marker.
When we convert decimal values to binary values however using the 12-bit diagram method you calculate from
left to right → .
As you can se the 12th bit with decimal value 2048 is too big to represent 13. The same goes for 11th, 10th, 9th, ... , down to the 5th bit with decimal value 16. They are all too big to represent 13. The 4th bit with value 8 however is good. So we scribble that down along with switching on the 4th bit with a 1 at the right corner.
3rd bit OK so scribble the numbers down.
2nd bit with the decimal value 2 will make the sum bigger than 13 so we switch that bit OFF with 0.
1st bit gives us the right sum. So you switch on that bit and thus 13Dec= 1101Bin.
Voila!
Step 2
Write down the 12-bit diagram on a piece of paper.
Convert the decimal value 2650 to binary format.
This time I'll skip a few steps so that I won't have to illustrate so much for the scans.
This way of grouping the bits is wrong and mean something else. I just do it for easy reading and accurate calculations. The correct answer should be without any spaces.
If you want to convert some other decimal values into binary values then it cannot be bigger than 4095Dec when using my 12-bit diagram. If you need to do it on some bigger number then you could make your own customized N:th-bit diagram. 2N-1= YDec