Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Binary code made easy!!!!!!

Author
Message
FBSinfoandfilm
16
Years of Service
User Offline
Joined: 12th Apr 2009
Location:
Posted: 13th Apr 2009 06:19
Binary code is the default language of computers. Each character is eight numbers long. Some groups of binary characters share a common, well, what I would like to call, “head”. For instance, numbers begin with 0011, w, r, t, y, u, p, s, z, x, and v begin with
0101, and so on. However binary code, unlike other TMLs (text markup languages), although it looks complicated, is actually a slight bit more user friendly than HTML (Hypertext Markup Language). This is because you have to enter a different entity for letters on the same key. Let’s say you wanted to type a 1 and an exclamation mark.
In HTML it would be1 and ! however in binary code you type the same character code for those two(00110001), but if you want the one you have to press shift for, all you have to do is enter the shift code(00010000).
Here is a translation table for the characters (remember that there are no spaces).























for text to binary translation paste this URL to your adress bar: http://www.harrold.org/rfhextra/text2binary.html

00100000= space
1=00110001
2=00110010
3=00110011
4=00110100
5=00110101
6=00110110
7=00110111
8=00111000
9=00111001
0=00110000
Q=1010001
W=01010111
E=01000101
R=01010010
T=01010100
Y=01011001
U=01010101
I=01001001
O=01001111
P=01010000
A=01000001
S=01010011
D=01000100
F=01000110
G=01000111
H=01001000
J=01001010
K=01001011
L=01001100
Z=01011010
X=01011000
C=01000011
V=01010110
B=01000010
N=01001110
M=01001101
Caps=00010100
Shift=00010000
Alt=00010010
Control=00010001
Backspace=00001000
(<,)=10111100
(>.)=10111110
(?/)=10111111
(;=10111010
(“’)=11011110
({[)=11011011
(}])=11011101
\)=11011100
(_-)=10111101
(+=)=10111011
(`~)=11000000

Gus Hinson
jasonhtml
21
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 13th Apr 2009 17:51
you know, you don't have to go around making all of these posts about stuff that just about everyone here already knows and your missing the rest of the ascii table, especially lowercase characters

Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 13th Apr 2009 17:53 Edited at: 13th Apr 2009 18:01
Quote: "Binary code is the default language of computers"

Not really, binary is the means by which they store information.

Quote: "Each character is eight numbers long"

No, each character is 8 bits long, and only when you are using ASCII with the extended character set. Standard ASCII is 7 bits long, with 1 byte for a data check.
With UTF-8, characters are 8, 16, 24 or 32 bits long depending on the character, and other Unicode formats can vary in character size even more.

Quote: "Some groups of binary characters share a common, well, what I would like to call, “head”. For instance, numbers begin with 0011, w, r, t, y, u, p, s, z, x, and v begin with
0101"


Well, duh... That's like saying that 102 and 109 share the same 'head' because they both start 10...

Quote: "HTML (Hypertext Markup Language)"

That is almost insulting!

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 13th Apr 2009 18:05
Give him a break guys, he only joined yesterday.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Apr 2009 18:15
Binary is one of those things that are useful to know, but well advised to avoid. Coders tend to only use binary when they need it, never to replace an easier standard like ASCII or hex.


Health, Ammo, and bacon and eggs!
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 13th Apr 2009 22:42
You don't need to prove that you're clever enough to be here, you know

mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 13th Apr 2009 23:01
I think its normal to get a bit excited when you realise that all those millions of transistors switching from 1 to 0 and 0 to 1 makes the whole darn thing work.
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 13th Apr 2009 23:13
ASCII values, buddy. Lookup a table.

That's what they WANT you to think...
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 14th Apr 2009 04:16
even when im programming a microchip (Yeah, im going to brag about it!) i use ASCII codes for text, so i dont have to use any binary! ...well, no, theres still tons of binary, but no letters!
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 14th Apr 2009 08:36
You will find most game developers still use binary for various things.

mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 14th Apr 2009 09:58
Quote: "even when im programming a microchip (Yeah, im going to brag about it!) i use ASCII"


Yeah. Even ASICs(Application Specific Integrated Circuits) need to be programmed in ASCII.
hatlawyer
User Banned
Posted: 15th Apr 2009 17:17
i know how to do standard numbers with binary

00000110 00000110 00000110 is 666

00001001 00000001 00000001 is 911

00000010 00000000 00000000 00001001 is 2009

00000001 00000010 00000011 00000100 00000101 00000110 is 123456

"stupid ass u cant hack or nuthin" "I GOT NORTON"
hatlawyer
User Banned
Posted: 15th Apr 2009 17:20
We learnt how to do binary number in electronics at high school. Not that i ever get chance to use it.

"stupid ass u cant hack or nuthin" "I GOT NORTON"
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 15th Apr 2009 17:20 Edited at: 15th Apr 2009 17:21
Quote: "00000110 00000110 00000110 is 666

00001001 00000001 00000001 is 911

00000010 00000000 00000000 00001001 is 2009

00000001 00000010 00000011 00000100 00000101 00000110 is 123456"


Actually, those are:

1010011010
1110001111
11111011001
11110001001000000

You're just simply doing 1 digit at a time, which is incorrect.

EDIT:

And please use the Edit button instead of double posting.

hatlawyer
User Banned
Posted: 15th Apr 2009 17:23 Edited at: 15th Apr 2009 17:26
Quote: "Actually, those are:

1010011010
1110001111
11111011001
11110001001000000"


Yea i forgot that doing seperate bytes would mean spaces inbetween the numbers.

[edit]but how can you have a binary number bigger than 8 digits?[/edit]

"stupid ass u cant hack or nuthin" "I GOT NORTON"
Butter fingers
19
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 15th Apr 2009 18:17 Edited at: 17th Apr 2009 07:51
I love when someone makes a post about binary and everyone comes out of the wood work to prove they could hold down a conversation with a computer.

MOD EDIT: Please don't stretch the forum.

I want robotic legs.
gbark
19
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 15th Apr 2009 19:41 Edited at: 15th Apr 2009 19:42
Quote: "but how can you have a binary number bigger than 8 digits?"


Binary is not limited to 8 digits. Binary simply means it's a number in base 2 (hence the "Bi").

Computers do generally use Binary in 8 digits. But technically, as long as the number consists of just 0's and 1's, it's Binary whether you use 1 or 100 digits.
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 15th Apr 2009 21:02
Real programmers use uninary.

Some use trinary.

Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 15th Apr 2009 21:08 Edited at: 17th Apr 2009 07:51
decode:
MOD EDIT: Please don't stretch the forum.
Detlef
17
Years of Service
User Offline
Joined: 3rd Mar 2008
Location: Gernamy
Posted: 15th Apr 2009 21:12
Quote: "Leon Kennedy wrote:

So, if I understand this right, you created a topic to tell all of us geeks out here about binary? I am wholly unimpressed..."



Mien nam is Detlef
MonoCoder
19
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 15th Apr 2009 21:32
Urinary made simple! Here's a tra-

back in two

DarkEye - a LUA-based event-driven engine-system thing for GUI's and 2D Games. Coming soon.
Insanity Complex
19
Years of Service
User Offline
Joined: 16th Sep 2005
Location: Home
Posted: 15th Apr 2009 23:26



www.aeriagames.com <-They have some decent ones
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th Apr 2009 23:43
Insanity, you spelled "converter" wrong.

I taught myself binary in highschool, which actually came in handy when a few errors happened during the shuttle launch (space tech final exam). In college we had to convert between binary, decimal, and hex. Not really difficult once you know how. As a bonus, we had to convert to octal.

[url="http://dbcc.zimnox.com"][/url]
mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 16th Apr 2009 01:06
Actually 101 is just binary for lol
All those transistors in there lol a lot. Sometimes they all loll
so much they have to go to the loo.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Apr 2009 12:02
Binary does become quite interesting when you learn how it all works with math, like multiplication of binary numbers. Once you see that stuff in action it's easier to understand why it's used so much, and why it's so important.

It's not just because the hardware relies on binary logic, it's because binary mathematics is so tangible and fast.


Health, Ammo, and bacon and eggs!
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 16th Apr 2009 12:37 Edited at: 16th Apr 2009 12:38
This number is written in base 10

Which base did I use?

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 16th Apr 2009 13:07 Edited at: 16th Apr 2009 17:16
When you start out with binary, one of the first questions you ask
is how can we work with binary numbers and perform the fundamental operations of addition and subtraction. Division is just repeated subtraction and multiplication is just repeated addition. The ALU using the fundamental binary adder unit is only capable of performing additon with a carry bit. So how do we do subtraction of binary numbers with the ALU? What exactly is a negative binary number?

Let A be a binary number
To find the negative number -A, such that
A - A = 0
But subtraction is just additon of a negative number
i.e. A +(-A) = 0 ---Equn.1
Clearly, this operation can be carried out by the ALU binary adder.

So all we need to do is find a number that is the negative binary representation of A, such that Equn.1 is satisfied.

Let A = b1 b2 ... bn be an n bit binary number
Let A' = c1 c2 ... cn be the 1's complement of A
i.e. for every bi = 0 let ci = 1 and vice versa
A + A' = 11...1 an n bit binary number with all bits 1
If we now add a binary 1 to A' we will have an n+1 bit binary number with all n bits 0 and the highest n+1 bit 1
Therefore if we carry out this addition in an n bit binary adder we would have the result of the addition as an n bit binary 0
We have therefore used the binary adder to perform the subtraction operation of Equn.1

This also leads us to define the 2's complement of a binary number as the (1's complement of the number) + 1, and conclude that the 2's complement of the number A is the negative binary representation of A

If at first you don't succeed, relax. You're like the rest of us.
mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 16th Apr 2009 13:33
Quote: "This number is written in base 10

Which base did I use?"


Nice.

Here's another one.
"This sentence is not True"
What is the truth value of this statement?
Venge
18
Years of Service
User Offline
Joined: 13th Sep 2006
Location: Iowa
Posted: 16th Apr 2009 15:37
Quote: "his number is written in base 10

Which base did I use?"


You know, there are 10 types of people in the world. Those that understand binary, and those that don't.

In the beginning, the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.
ionstream
20
Years of Service
User Offline
Joined: 4th Jul 2004
Location: Overweb
Posted: 16th Apr 2009 19:38
Quote: "This number is written in base 10

Which base did I use?"


Every base.

BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 16th Apr 2009 19:48
Quote: "Every base."


Actually, I'm fairly sure that isn't base 16.



Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 16th Apr 2009 19:59 Edited at: 16th Apr 2009 20:00
Quote: "Actually, I'm fairly sure that isn't base 16."

Why not? It can be any base. 10 as base 16 is 16 as base 10.

BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 16th Apr 2009 20:06
Ah, yeah, I see. I was thinking 10 wouldn't mean anything in base 16 as 10 in base 16 was actually A...that made no sense once I actually typed it out



Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 17th Apr 2009 07:54
One way developers can use binary nowadays is to store user settings. For example if you have different options (i.e. low/high graphics settings) you can assign them to individual bits in a byte. Then you use some simple bit shifting to store and retrieve their states.

mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 17th Apr 2009 12:34
Yeah. If you're working with embedded systems where memory is scarce every bit counts.
One technique that springs to mind when using ASM is toggling the nth bit in a word by XORing with a word that has all bits 0 and the nth bit 1
This leaves all bits in the original word unchanged while toggling the nth bit.

So many women, such little chance.
hatlawyer
User Banned
Posted: 17th Apr 2009 20:43
Quote: "Which base did I use?""


All your base are belong to us?

"stupid ass u cant hack or nuthin" "I GOT NORTON"
Aaron Miller
19
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 17th Apr 2009 21:14
Quote: "If you're working with embedded systems where memory is scarce every bit counts."

I think that every developer should make an effort to not have a ton of bytes that only hold a '0' or a '1' and use bit flags instead (if they are related.) That's actually a bit "harder" to do in DBPro, but it's easy as pi in C and C++ (macros.)

Cheers,

-naota

I'm not a dictator to those that do stuff for me by will. Only those who don't.

Login to post a reply

Server time is: 2025-06-06 16:05:57
Your offset time is: 2025-06-06 16:05:57