Binary...

Anything you like!
Post Reply
Stew
Posts: 495
Joined: 02 Mar 2018, 10:21
Location: Staindrop, Darlington.

Binary...

Post by Stew »

Simple question. A computer can convert text instructions i.e a program, into binary numbers via a series of processes. I get it that far, but how does it read the zeros and ones?
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: Binary...

Post by Martin »

From the point of view of the computer processor, they're not really zeros and ones - they're more like switches that can be in one of two positions - and the processor 'sees' the state of those switches usually by the presence or absence of a voltage. We just like to use the model of ones and zeros as it helps us to describe and think about what's happening in a simpler way.

So the processor loads those states - say eight or sixteen or whatever at a time into a special register that's wired up to do different things depending on the pattern of voltages present. A mechanical analogy is a lock which is designed to do one thing (allow rotation) when it 'sees' the correct pattern of an inserted key.

The processor register doesn't just react to one pattern - it has different reactions to different patterns - so one pattern might cause it to add two 'numbers' (also represented in binary) present in other registers together - and another pattern might cause it to check which of two numbers is the larger, or if they are both the same.

Once you have a few simple operations like add, subtract, test for equality, and so on, you can use hundreds of such operations to do something more complicated like multiplication, and you can use millions of such operations to do something more complicated still - like word processing or beating you at chess.
Stew
Posts: 495
Joined: 02 Mar 2018, 10:21
Location: Staindrop, Darlington.

Re: Binary...

Post by Stew »

Thank you for that! Your answer totally explains it for me. Several hours of 'Googling' that didn't come up with an answer that made sense, but that one cut right through the crap. 'We just like to use the model of zeros and ones'

Thanks again.

Stew.
Post Reply