Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 01-08-2003, 08:42 PM   #1
Member (5 bit)
 
Join Date: Aug 2002
Location: KTM, NP
Posts: 25
Send a message via Yahoo to SudyZenziGrg
binary value of G

hello PCmech members and non-members,
I had this question in a quiz competition but it went over my head. I don't have a clue/ procedure on how to find the binary value of the letter G and g. Please help me to come out of this problem.
And also, please give me the procedure to solve this problem, as it'll be helpful later. Your help is highly appreciated. Thanks...
SudyZenziGrg is offline   Reply With Quote
Old 01-08-2003, 09:27 PM   #2
Member (10 bit)
 
David_Jones's Avatar
 
Join Date: May 2000
Location: New Zealand
Posts: 546
Depends what they mean.

Could be that G / g = 7 (decimal) being the 7th letter of the English alphabet, and is therefore 111 in binary.

Could also be the ASCII code for 'g' and 'G' (103 and 71 decimal if I have it looked up right), converted to binary (I'll leave that conversion to you).

To be fair, the question is very ambiguous!

David.
David_Jones is offline   Reply With Quote
Old 01-08-2003, 09:45 PM   #3
Member (5 bit)
 
Join Date: Aug 2002
Location: KTM, NP
Posts: 25
Send a message via Yahoo to SudyZenziGrg
hi Mr. D_J,
I'm sorry for I missed some parts of the question. Yes, the question is ambiguous. The question is :

What is the Binary conversion of the Character "G"?

Please tell me how it's done. Or are there any site that teaches binary and how to do these types of problems? It'll be useful later. Thanks in advance!

"A little knowledge is a dangerous thing"
SudyZenziGrg is offline   Reply With Quote
Old 01-08-2003, 10:12 PM   #4
Member (12 bit)
 
Paul Victorey's Avatar
 
Join Date: Mar 1999
Location: MN or WI
Posts: 3,017
Well, you need to know the ASCII codes of those characters. Would you be given them in hexadecimal? I'll assume not, but I'll assume you know the basics of hexadecimal (e.g. numbers run 0-F, you have a ones digit, a sixteens digit, a two-fifty-sixes digit, etc.)

In any event, 'G' is 47h, 'g' is 67h. You can remember this because for capitals, you add 40h, for lowercase, add 60h. Since g is the 7th letter, which is 07h, add these (in hex!) to get the hexadecimal values.

I'll work through an example, the letter z:

1) Z is the 26th letter.
2) Convert 26 to hex.

* 26 is greater than 16 and less than 32, so the 'sixteens' digit is '1'. So we know that it is 1_h.
* 26 - 16 = 10, so the 'ones' digit is 'A'.

So, z is the '1A'th letter of the alphabet.

3) Add either 40h or 60h. 40h for capitals, 60h for lowercase.

So, the character 'Z' = 1Ah + 40h = 5Ah. Similarly, 'z' = 1Ah + 60h = 7Ah.

4) Now, to convert from hex to binary is very easy. Each hex digit is replaced with 4 bits. You convert each digit separately (this works because 16 is a power of 2).

So, 'Z' = 5Ah. 5 = 0101, A = 1010. So 'Z' = 0101 1010

Similarly, 'z' = 7Ah = 0111 1010.

Hope that helps.

BTW, to convert from hex to binary, you need to know the following:

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

You can always remember this because each bit, from right to left, represents a power of 2. So, from left to right, the bits represent 8, 4, 2, 1. 'C' = 12 decimal = 8 + 4, so the 8 and 4 bits are set.

Last edited by Paul Victorey; 01-08-2003 at 10:19 PM.
Paul Victorey is offline   Reply With Quote
Old 01-08-2003, 10:42 PM   #5
Member (10 bit)
Premium Member
 
CaptTuna's Avatar
 
Join Date: Mar 2001
Location: N'Awlins, LA
Posts: 517
6
CaptTuna is offline   Reply With Quote
Old 01-13-2003, 08:45 PM   #6
Member (5 bit)
 
Join Date: Aug 2002
Location: KTM, NP
Posts: 25
Send a message via Yahoo to SudyZenziGrg
hi paul,
thanks for your help. It is highly appreciated. One more thing ;-). Are there any good sites that i can learn binary number systems? If you know any sites then please do not hesitate to post the URL. Thanks...Cheers!!!
SudyZenziGrg is offline   Reply With Quote
Old 01-13-2003, 09:10 PM   #7
Member (12 bit)
 
Paul Victorey's Avatar
 
Join Date: Mar 1999
Location: MN or WI
Posts: 3,017
You can try this:

http://www.swansontec.com/sbinary.htm

Has info on binary and hex.
Paul Victorey is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:28 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2