Hi everyone,
Would someone please be able to explain to me how you would be able to convert hexadecimal into decimal numbers and vice versa? and also I am confused with how desk checks work.
Thanks!
There's a special technique for converting hexadecimal to decimal but I just can't remember it right now. Try and search for it, maybe someone else on here knows it. Sorry about that.
Now a desk check is just a manual way of checking the output of your algorithm. You should create a table with each variable with each column representing one variable. Then from top to bottom just write down the value of each of the variables one by one.
I want you to try this question that i have attached so I know where your problem lies. NOTE: This is a really basic exercise
Show us how you desk check
I just randomly happened to see this. (Probably already figured out by now but I'll address the HEX thing anyway.)
Base 10 works through powers of 10. If I have a number, say, 923
10, what I mean is \((9\times 10^2) + (2\times 10^1) + (3\times 10^0)\).
Base 16 works through powers of 16. Of course, there are a few subtleties in that
1
10 = 1
162
10 = 2
163
10 = 3
164
10 = 4
165
10 = 5
166
10 = 6
167
10 = 7
168
10 = 8
169
10 = 9
1610
10 = A
1611
10 = B
1612
10 = C
1613
10 = D
1614
10 = E
1615
10 = F
16So if I have a base 16 number, say, A97E
16, what I am really saying is \( (10\times 16^3) +( 9\times 16^2) +( 7\times 16^1) + (14\times 16^0)\).
(Once the expression is written out, you can just grab a calculator to do it for you.)
Trying to go the other way though (DEC to HEX) is nastier.