»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Off Topic Community

Reply
 
LinkBack Thread Tools Display Modes
Old 09-08-2002, 10:54 PM   #1 (permalink)
Banned
 
Join Date: Sep 2002
Posts: 189
LinuxNewbie is on a distinguished road
can binary be broken into hex bitwise?

binary is 1s and 0s
if we have a number like 101001110101011 can it be broken down directly into hex without having to figure out what the original binary number's value even was?

i ask because a book of mine shows how to break down binary into octal bit-wise. here is how it says:
"we take a binary number and break it into groups of 3 bits starting at the right
11100110101 turns into:
11 100 110 101 after broken into groups of 3
now we get the values for those groups of 3 which turns into this:
3 4 6 5 then take out the spaces and we get 3465

11100110101 is equal to 03465 (the 0 indicates it is an octal number)"

can we do something like that for hex as well?

and is there a way to convert octal to decimal quickly? by looking at the number 0702 in octal i can't just immediatley convert it to a number in decimal, i dont know how.


Last edited by LinuxNewbie; 09-08-2002 at 11:08 PM.
LinuxNewbie is offline   Reply With Quote
Old 09-08-2002, 10:58 PM   #2 (permalink)
Registered User
 
originel's Avatar
 
Join Date: Jun 2002
Location: Texas Tech
Posts: 1,538
originel is on a distinguished road
Send a message via AIM to originel
yeah sure. one of the cool things about hex and binary is that for every eight digits of binary, you have exactly two digits of hex.

i.e.
11111111000000001111111100000000 in binary equals:
FF00FF00 in hex.

this is essentially what a hex editor does.

as for quickly converting octal to decimal, i'm not so sure there is an easy way. if there is the EE and CS departments here at Tech sure don't teach them.

EDIT: with octal you beark up binary into groups of three. 11100110101 = 3465o. if you've got a ti 8x calc, it'll do it for you up to 8 bits in binary, after that things get strange (it uses what's called two's complement for negatives, i'm still trying to get where it's coming from on some things).

Last edited by originel; 09-08-2002 at 11:04 PM.
originel is offline   Reply With Quote
Old 09-08-2002, 11:07 PM   #3 (permalink)
Banned
 
Join Date: Sep 2002
Posts: 189
LinuxNewbie is on a distinguished road
oh yeah 3 my bad, sorry there
. io'll edit the first post.

having to deal with chmod i should know that by now lol
LinuxNewbie is offline   Reply With Quote
Old 09-09-2002, 10:34 AM   #4 (permalink)
Registered User
 
SickPup404's Avatar
 
Join Date: Oct 2001
Location: Sussex county, Delaware, USA
Posts: 1,156
SickPup404 is on a distinguished road
Send a message via ICQ to SickPup404
With hex, you can't still think in decimal. You can convert like you were asking, but use groups of four. However, you have to think hex to do it:
0000 = 0x
0001 = 1x
0010 = 2x
0011 = 3x
0100 = 4x
0101 = 5x
0110 = 6x
0111 = 7x
1000 = 8x
1001 = 9x
1010 = Ax
1011 = Bx
1100 = Cx
1101 = Dx
1110 = Ex
1111 = Fx

So using your example:
11100110101
(0)111 0011 0101
7 3 5
735x

You group binary this way because of the numbers' base. Octal is Base-8, so you grab the most binary digits you can to fit in 8 (0-7). That's 3 binary places (111=7). Same goes for hex (Base-16, or 0-15) and that's four places (1111=15).

The easy way to do it is using the Windows Calulator in scientific mode. (as recommended to me by my MCSE instructor for the exams) Once you understand binary, you should understand subnet masks quite easily!

Lots of fun stuff!!
SickPup404 is offline   Reply With Quote
Old 09-09-2002, 03:46 PM   #5 (permalink)
Banned
 
Join Date: Sep 2002
Posts: 189
LinuxNewbie is on a distinguished road
they don't teach us this in math for some reason, i think octal is a fantastic number system for determining which things have which properties....like chmod.
LinuxNewbie is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 10:40 PM.