Easiest way to remember how to convert from different number systems? Watch

Bas15448985
Badges: 10
Rep:
?
#1
Report Thread starter 4 months ago
#1
I'm doing a networks and security course at university and I need help on how I can remember how to convert from a number to another number, I have an exam on converting between binary, octal, decimal (denary) and hexidecimal so I could be asked to convert from:

binary to hexadecimal
binary to decimal
binary to octal
________________________
octal to binary
octal to decimal
octal to hexadecimal
________________________
decimal to binary
decimal to octal
decimal to hexadecimal
________________________
hexadecimal to decimal
hexadecimal to octal
hexadecimal to binary

There's two number lists that goes like this and it and I use one of them to carry out some of these conversions (base number 2):

128, 64, 32, 16, 8, 4, 2, 1
8, 4, 2, 1 8, 4, 2, 1

The problem is, how do I know and remember of which of the two number lists I use for each of those conversion scenarios? I always keep forgetting which one to use.

Thanks.
Last edited by Bas15448985; 4 months ago
0
reply
winterscoming
Badges: 18
Rep:
?
#2
Report 4 months ago
#2
Firstly, make sure you've mastered Binary, that's the prerequisite to being comfortable with the rest.

Once you're OK with that, then you can use the fact that converting between Hex/Binary and Oct/Binary are both extremely trivial so start out by learning those, and you can use those tricks to figure out the rest.
  • A single 'hex digit' is 4 bits (0 to 15)
  • A single 'oct digit' is 3 bits (0 to 7)


So, a 'hex number' of 7EF2 has 4 hex digits. That means it has 16 bits. Each translates directly into a set of 4 bits - i.e.
Code:
7    E    F    2
0111  1110  1111  0010
That's good because it means you can really quickly convert between Hex/Binary. Just focus on a simple mapping between the sequences of 4 bits and the individual Hex digits.

Octal is the same, except there are 3 bits per octal digit. For example, with the octal number 6341:
Code:
6   3   4   1
110 011 100 001
This is good because it means binary can be a really fast intermediate step in-between your conversion between Hex/Octal.

For example, how to convert Hex 4D7A into Octal:
Code:
4    D    7    A
0100 1101 0111 1010
Now you have the binary, just rearrange the spacing between the digits and convert:
Code:
000 100 110 101 111 010
0   4   6   5   7   2
Therefore, Hex 4D7A = Oct 46572


Hex and Octal are "special" because of these tricks -- in fact, the reason why Hex and Octal are widely used is precisely because it's so fast for a human to quickly translate them to Binary.

Most other number bases are a bit more awkward, and they require a little bit more of a standard method, but really it's just like learning to add numbers up in primary school.

Binary digit positions are just powers of 2 -- so your positions (in decimal) are 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc.

If you can convert between decimal/binary then you can use binary as the fast intermediate step for reaching Hex/Oct too.
1
reply
Bas15448985
Badges: 10
Rep:
?
#3
Report Thread starter 4 months ago
#3
So that means I’m using 8, 4, 2, 1 for hex binary and 4, 2, 1 for Octal?

And for decimal (denary) it will only be the 128, 64, 32, 16, 8, 4, 2, 1?
Posted on the TSR App. Download from Apple or Google Play
Last edited by Bas15448985; 4 months ago
0
reply
winterscoming
Badges: 18
Rep:
?
#4
Report 4 months ago
#4
(Original post by Bas15448985)
So that means I’m using 8, 4, 2, 1 for hex binary and 4, 2, 1 for Octal?
Correct (per digit)

(Original post by Bas15448985)
And for decimal (denary) it will only be the 128, 64, 32, 16, 8, 4, 2, 1?
Yep, you've got it. By the way, if you want a fun way to practice quick-thinking for binary-decimal, have a look at this game:
https://studio.code.org/projects/app...zqgoxuu810unLw
0
reply
Bas15448985
Badges: 10
Rep:
?
#5
Report Thread starter 4 months ago
#5
Ok, thank you so much for your help!! You’re a lifesaver!
Posted on the TSR App. Download from Apple or Google Play
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • University of Roehampton
    Department of Humanities; Department of Drama, Theatre and Performance; Department of Social Sciences; Department of English and Creative Writing Undergraduate
    Wed, 20 Feb '19
  • Keele University
    Postgraduate Open Afternoon Postgraduate
    Wed, 20 Feb '19
  • Manchester Metropolitan University
    Postgraduate Open Day Postgraduate
    Wed, 20 Feb '19

Do unconditional offers make teenagers lazy?

Yes (44)
60.27%
No (29)
39.73%

Watched Threads

View All
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise