|
Re: Nerds wanted - binary help
| quote: | Originally posted by Michael19
right so lads. Need help with binary addition etc.
i know how to work normal binary. One thing i dont know is ones and twos complement subtraction though.
say the question is 110101 - 011011 base 2.
I change 011011 to 100100 dont i? is that all i need to do, just work it out then or is there more?
Need to know how to convert from octal and hexadecimal to binary aswell.
e.g
123(base 8) to octal and hexi - how do i do it?
any help would be brilliant.
cheers. |
well base 8 is octal...i think u meant, from octal to binary/hex?
its prob easier to just convert to binary, then go to either octal or hex, so in hex, u group every 4 numbers, and in octal u group every 3
so 10101110 the last digit in octal is 6(110), and in hex its E(1110), and u just move along and do the whole thing so hex = AE, octal = 256
if u do octal - hex or other way, just convert to binary first
so 123 = 001 010 011 in octal, and = 0001 0010 0011 in hex,
ones complement as i recall, u just flip all digits, so 1101 = 0010
in 2's complement u do the same thing, except add 1 at the end
so 1110 = 0001 + 1 = 0010
and then u just add them together (but that might be wrong, thers some rules about the last digit or some crap, i dont remember )
___________________
it was the greatest feeling of nothingness i have ever experienced...
|