# does anyone know binary

By etones ยท 14 replies
Oct 16, 2005
1. ### jobeardTS AmbassadorPosts: 11,131   +982

Binary is a number system with a base number of 2.
The common system humans use is base 10. We don't think of it in this manner,
but the number 123 (in base 10 or decimal) is 1x10^2 + 2*10^1+3x10^0
10^2 is 10*10, or
10 to the second power or
10 squared and
any base number to the zero power is always 1

Binary just changes the base number and it calculates the same way.
binary has only has a zero or a one in the number range. The binary number 100 is 1x2^2+0*2^1+0*2^0
0 x anything is zero so it reduces to 1x2^2 or 4 (decimal)
5 decimal would then be 101 in binary.

I'll leave the history, usage of, and follow-on number systems to the instructor.

PS: computers do not use binary today. Listen carefully to find the answer :giddy:

2. ### SpikeTS EvangelistPosts: 2,168

They doo use binary, as do all logic circuits in electronics (1=true, 0=false). When you press a key on your keyboard it sends a binary pulse to the computer unique to each key (ASCII).

However, computers use binary at their lowest and most complicated level of operation. These days (and for a very long time now!) binary is convereted to a much more workable system for the user/programmer, being Octal (Base 8) and more often than not, Hexadecimal (Base 16).

I never did learn and remember how to work in binary properly.. However, there is a cheats way From right to left in a binary sequence, the value of each digit doubles, and so...

8 4 2 1
1 1 1 0 = 14 in decimal

As an aside, an interesting little puzzle along such lines... Disarm the Bomb

3. ### jobeardTS AmbassadorPosts: 11,131   +982

This is what I was inferring, base16, hexadecimal which has 'numbers' in the
range 0-9,a-f. Base16 is <> Base2 and therefore is not binary. Memory opertaions
take place on 8bits and this creates a maximum value of FF(base16), or 255(base10). These are not binary.

It is always true that a 'digital computer' uses binary logic cards and circuitry.
If your definition of binary extends to software implementation to testing or
comparing values ( if x equals y then ... ), then you're right, because that's
the only way to create the code to trigger the hardware do the evaluation.

There are two common character codings, ASCII and EBSDIC, both operating
over the full range of Base16. A character encoding is the 'Roseta Stone' used to 'assign value'
to a given number or location in the address range. For example, EBCDIC assigns
the character 'A' to the location C1, while ASCII assigns 'A' to 41

There have been some recent machine that use a 7bit code known as Octal,
eg: Tandem NSii. RS232 serial line coding is also 7bit chunks.

Strickly speaking, Binary is a number system using Base2.

4. ### NodsuTS RookiePosts: 5,837   +6

You are all confusing the poor chap..

etones: It will be about how to present different numbers in binary (there are several ways) and how to preform basic calculations. Nothing to it really.. Learning all numbers 1-15 in binary and powers of 2 up to ~15 will help

5. ### SpikeTS EvangelistPosts: 2,168

As ever Nodsu, you are correct. We probably were confusing the poor chap.

numbers 1-15 in binary (there's a simple pattern if you look for it)...

6. ### etonesTS RookieTopic StarterPosts: 146

im starting to understand a bit, im sort of getting what Nodsu and Spike are posting.

ok so say i have 20 and i want to make it into binary it would be

16 8 4 2 1
1 0 1 0 0

so the answer is = 10100 is that right

7. ### SpikeTS EvangelistPosts: 2,168

It is correct. Hopefully you've also seen the pattern as you look down each column too and spotted the pattern.

One thing you need to remember though is that that is the cheats way of doing it, useful for small numbers, but ultimately useless for longer ones.

8. ### kirockTS RookiePosts: 1,221

Binary logic

All of the above is very good and true, but might I add:

All digital logic circuits (as in computers) use 1's and 0's to determine an outcome of a True/False condition. The rules of representing decimal numbers are as given above. 10100 = 20. But part of the course should include the basic logic of 1's and 0's as applied to logic gates such as AND, OR etc.

An AND gate is the symbolic logic of: If A and B, then C. So 1+1=1. You need two 1's ( a 1 at each gate input (assuming a 2 input AND for simplicity) to get a True or 1 output. So AND gate truth table looks like:
Input 1 Input2 Output
0 0 0
1 0 0
0 1 0
1 1 1

This the fundamentals on making a "decision" in the machine world. The first computers were machincal, then moved to relays and then on to transistors. If fact the term "bug", as in ; " I have a bug in my code". came from a female computer engineer/mathematician in 1948 working for the Department of Defence in the USA. A two floor relay based computer was crunching numbers overnight and when she went to review the results in the morning they were all wrong. After investigating the problem she found a moth dead between one of the relay contacts. In her logbook she noted: "Bug in machine" and it became part of our vernacular.

The OR gate is the logic of: If A or B then C. So 0+1=1 or 1+0=1. If EITHER condition is true then C is true! So truth table for OR gate is:
Input 1 Input2 Output
0 0 0
1 0 1
0 1 1
1 1 1

Now there are many other gates such as Exclusive OR, NAND gate (negated inputs of an AND gate). All these togther make up how a computer works. The logic gates have now been replaced with a CPU, the OS controls the 100 million or so TTL (transistor-transistor logic)logic gates inside the microprocessor at any given nanosecond (X.xGHz clock frequency). Therefore the OS is making certain parts of the CPU circuit act like an AND gate for an instruction, then like an OR gate and so on. All of this is happening at billions of times a second (64bits X 2.4Ghz AMD64 processor for example) in order for me to type this response. :rolleyes:

OK now I think we confused him. My work here is done.

9. ### patioTS GuruPosts: 482

There are 10 types of people...those who understand binary and those who don't.

patio.

10. ### SpikeTS EvangelistPosts: 2,168

that makes 11 of us

11. ### jobeardTS AmbassadorPosts: 11,131   +982

sweet :approve:

12. ### patioTS GuruPosts: 482

"For a good prime call"... :haha: :haha: :haha:

I just noticed that Spike !

patio.

13. ### SpikeTS EvangelistPosts: 2,168

lol... It's been there for ages

14. ### patioTS GuruPosts: 482

It's that old age thingy...

patio.