06.06.2013 Views

Computer Programming with GNU Smalltalk - Free

Computer Programming with GNU Smalltalk - Free

Computer Programming with GNU Smalltalk - Free

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6 <strong>Computer</strong> <strong>Programming</strong> <strong>with</strong> <strong>GNU</strong> <strong>Smalltalk</strong><br />

programmer to use only one programming paradigm are called single-paradigm programming language.<br />

<strong>Smalltalk</strong> is one of the first object oriented programming languages and it is a purely object oriented<br />

programming language. So, it is a single-paradigm programming language and you will look everything<br />

as an object.<br />

Number Systems<br />

We briefly mentioned that computer hardware can only understand ones and zeros. Now we will<br />

explain the reason a little more detailed. The hardware used commonly in computers today can track<br />

only two states because of their design. We can call this states as on and off, for example. So humans<br />

needed a way to describe the world in just two symbols. Ways to describe mathematics in two symbols<br />

are already implemented so they just needed to represent other things in two symbols. For example,<br />

how can you represent a refrigerator in computer world? We can represent it as a collection of some<br />

strings. Then how can we represent strings <strong>with</strong> just two symbols? Humans developed ways to represent<br />

strings in two symbols which we will show you in topic File Formats. We presented some states but we<br />

should be able to change these states. We achieve this via defining some basic commands and<br />

constructing more complex ones on top of the more basic ones. This is the way from machine language<br />

to Assembly language and to higher level languages like the ones we mentioned before in this chapter.<br />

Question:<br />

Although we tried to give you an idea of what happens in a computer, we won't cover this techniques in<br />

detail. Maybe you can try yourself to imagine how to create a world in just two symbols. This will be really<br />

helpful to create an understanding of computer and will be an interesting practice for you. After imagining<br />

yourself a little bit you may look at the Assembly language to see how Assembly solved this problem. Of<br />

course, it will be very hard for beginners so we recommend that you finish this text before.<br />

Now we will mention about the arithmetic part of the two symbol world. Though we won't cover it<br />

detailed not to bore you <strong>with</strong> mathematics concepts. You can always look at any algebra book to get a<br />

deep insight of the materials we will introduce you next.<br />

Base-10 (Decimal) Number System<br />

We use ten symbols (0, 1, 2, 3, 4, 5, 6, 7, 8 and 9) to represent the numbers in our daily life. Why ten<br />

and not nine or eleven? Is this how the world is created, in ten symbols to represent numbers? Of<br />

course not. We can represent numbers in as many symbols as we want. The reason we use ten symbols<br />

is that we are used to it. It is thought to be used by first Indians and spread the world from there. Why<br />

Indians choose ten is thought to be because humans have ten fingers.<br />

Base-2 (Binary) Number System<br />

Mathematics allows us to use as many symbols as we want to represent numbers. Because we can use<br />

just two symbols in computer architecture, base-2 system is ideal for this job. Base-2 numbers are

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!