Question:
Want to learn more about hexadecimal?
Andrew
2012-10-05 19:48:33 UTC
ok so when ever i try to find out about binary and hex, i always get the same answer. People just tell you how to convert from decimal to hexadecimal or to binary. Where can i go to learn about hexadecimal MACHINE CODE so i can acually control computers with hex... i cant find anywhere that has much information about it? can anyone help?
Four answers:
GazdGod
2012-10-05 20:15:33 UTC
HEX is simply a short-hand way of writing a binary number (just as decimal is). Hexidecimal just means that the numbers are to base 16 instead of base 2 (binary) or base 10 (decimal). So you can count from 0 to 15 before you go on to a more significant bit.



Decimal:

0 1 2 3 4 5 6 7 8 9



Hex:

0 1 2 3 4 5 6 7 8 9 A B C D E F



Binary:

0 1
Phoenix
2012-10-06 03:09:59 UTC
Machine code is binary not HEX



HEX is base 16 numbering, everyone learns base 10 in school:





Base 10 (Dec):



0 1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19

20 21 22 23 24 25 26 27 28 29 30



Base 16 (Hex):



0 1 2 3 4 5 6 7 8 9

A B C D E F 10 11 12 13

14 15 16 17 18 19 1A 1B 1C 1D

1E 1F 20 21 22 23 24 25 26 27
Drew
2012-10-06 05:18:29 UTC
Think about number systems like this .....



In base 10 number system we have the



10^3=1000 10^2=100 10^1=10 10^0=1

these are our different places.. 1's 10's 100's .........



its the same in any number system... The difference is that instead of 0 through 10 in base 10... in hex we have 0 through 9 and A through F ....



for hex...



16^4=65,536 16^3=4096 16^2=256 16^1=16 16^0=16



Lets say that we want to represent the number 4016 first in decimal then in hex below





10^4=10000 10^3=1000 10^2=100 10^1=10 10^0=1

we have 0 10,000's 4 1000's 0 100's 1 10's and 6 1's





now in hex





16^4=65,536 16^3=4096 16^2=256 16^1=16 16^0=1



we have 15 256's and 11 16's and 0 1's

to total 3840 with a remainder of 176 with a 0 remainder

the letter that cooresponds to 15 in hex is F

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

the letter that cooresponds to 11 in hex is B



therefore 4016 in base 10 can be represented as FB0 in base 16

This method if it makes any sense can be used for any base number system...

if this is a confusing way to explain it I can try a different method just let me know
Dennis_Sparrow
2012-10-06 03:55:01 UTC
Machine code is different for different kinds of computer hardware. You can't write binary or hexadecimal code that will work on just any random computer. So if you want to write machine code, you first have to decide what kind of processor you will work with, and then get the low-level documentation for that kind of hardware.



For a longer discussion, see:



http://programmers.stackexchange.com/questions/126095/resources-on-learning-to-program-in-machine-code


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...