Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Bits

Name: Anonymous 2011-12-05 17:33

Hi /prog/rammers...

I'm an hobby programmer and I'm here to ask a really simple question... I tried to google it but I don't even know where to start my search

the notation:
0x00 = 00000000
how it is called?
how can I convert an 8bit array in this form?
for example how can I discover the notation or the bit pattern?
?? = 00110100
0xff = ??

can someone explain me the logic behind?

thank you...

Name: Anonymous 2011-12-05 19:43

>>7
I did a small converter in python (before seeing your post):

dicthex_bin = {
"0":"0000",
"1":"0001",
"2":"0010",
"3":"0011",
"4":"0100",
"5":"0101",
"6":"0110",
"7":"0111",
"8":"1000",
"9":"1001",
"A":"1010",
"B":"1011",
"C":"1100",
"D":"1101",
"E":"1110",
"F":"1111"
}

dictbin_hex = dict((v,k) for k, v in dicthex_bin.iteritems())

def hex_to_binary(hex_str):
    bin = ""
    for letter in hex_str:
        bin += dicthex_bin[letter]
    return bin



>>8
maybe relevant to your "learn C basics":
http://www.youtube.com/watch?v=NaeqUp3jbls

btw... I'm going through the NeonHelium tutorial but is very old... and I don't find the glaux library (XCode4, gcc)... so pretty much all of the code wrote by NeHe is not useful to me...

I'm following the Addison, because although is older, it teachs in my opinion more profoundly what the heck all the things means.

I knew about the hex notation so I'm feeling embarassed up to 57005 for being misguided by a 0x in front of each hex representation...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List