Выбрать главу

Figure 10.13 A logic-based language

Prolog is another non-procedural language in that it is not a route to a goal but a set of information and a method from which the result can be deduced. Basically the idea is to feed in some facts and ask the program to produce some conclusions. You will remember the little logic puzzles like ‘Graham is married to Anne, Kirk is the son of Peter and the brother of Matt … Is Kirk the brother of …’ You know the sort of thing – more and more interconnected pieces of information until your head hurts. Just the job for Prolog.

The program includes facts and rules then we can ask questions. Here is a really simple example.

Facts:

coins (franc, france)

coins (centime, france)

coins (dollar, usa)

coins (cent, usa)

Rules:

french(x):–coins (x,france)

american(x):–coins (x,american)

Now we ask some questions:

?french (centime)

answer: Yes

?french (dollar)

answer: No

OK so far, but:

?american (dime)

answer: No

It has no data so it cannot say that dime is correct so it plays safe and says it is incorrect.

The future

Increasing microprocessor speeds and using several to share the processing tasks together with the decreasing size and cost of memory will be the key to the future. The idea of a desktop computer running at 20 GHz and having 128 Gbytes of memory is no longer ridiculous. In fact, it is looking rather modest after looking at Table 10.1 in which the trend over the last 26 years is projected another 26 years into the future.

It cannot keep increasing’ – quote of the year 1972, 1973, 1974, 1975, 1976…

Table 10.1

Similarly priced microprocessor systems Intel 4004 in 1972 Intel Pentium in 1998 Microprocessor in 2024
Clock speed 0.108 MHz 300 MHz 833 GHz
Memory 640 bytes 64 Mbytes 6.4 Tbytes
Performance (MIPS) 0.06 approx. 600 approx. 6 000 000

A persistent occupant of my crystal ball is real spoken voice communication. A few years ago voice recognition was only a dream and is now a reality and becoming increasingly efficient. Voice synthesis is progressing nicely and is beginning to sound less robotic. When these two technologies mature, simultaneous language translation will not be far away and real dialog with the computer will begin. Another million television programs suddenly become available without sub-titles (you see, all progress comes at a price!). Six million, million instructions per second and 800 GHz clock speed together with total voice control of computer functions will be here in a few years.

How about that Mr Spock?

Fascinating

That’s my guess.

At least it is something to look back and smile about in the future.

Quiz time 10

In each case, choose the best option.

1 A compiler:

(a) converts machine code to a high level language.

(b) is faster than an interpreter.

(c) is another name for a linker.

(d) is not available for the Basic language.

2 APL was largely influenced by:

(a) Cobol and Prolog.

(b) Lisp and Fortran.

(c) Fortran and Basic.

(d) Pascal and Cobol.

3 A fourth generation language can be described as a language which:

(a) is still being used.

(b) is object-oriented.

(c) was developed for artificial intelligence.

(d) is non-procedural.

4 A language designed to allow logical deductions to be made from input data is:

(a) C.

(b) Latin.

(c) Prolog.

(d) Fortran.

5 Pascaclass="underline"

(a) is a low level language compared with C.

(b) is only of use if you are going to translate it to European languages.

(c) is a highly structured language.

(d) was the first popular high-level language.

11. The development of microprocessors and microcontrollers

Micros are getting bigger – and faster

As the complexity of microprocessors and other digital integrated circuits has increased, there has been an inevitable increase in the number of transistors that are incorporated in their design.

In the list below, we have used transistors or their equivalent. These classifications are not universally accepted, there are different names and numbers floating around, so a degree of flexibility should be employed when comparing different sources. This is particularly true at the large end where the terminology has not yet ‘firmed up’.

SSI Small scale integration 1–10 transistors
MSI Medium scale integration 10–1000 transistors
LSI Large scale integration 1000–10 000 transistors
VLSI Very large scale integration 10 000–100 000 transistors
SLSI Super large scale integration 100 000–1 million transistors
ULSI Ultra large scale integration 1–10 million transistors

The increase in the number of devices has also had the effect of necessarily decreasing the size of each component. If the same component size were used for the current front runners as was used for the original 4004 microprocessor, they would be about the same size as a page of this book. For reasons that we will look at in a moment, unless we reduced the size of the components, we couldn’t increase the speed of operation and so the current microprocessors would have a maximum clock speed of under 1 MHz.

How do we measure the speed of a microprocessor?

This is a lot more difficult than we think because the developers of microprocessors are in competition with each other so as soon as a method is suggested, they try to exploit the situation to present their microprocessor as faster than all the others.

Be wary when reading comparisons – which tests have they chosen, and why? While watching the last Olympic games, it occurred to me that I was probably faster that any of those competing in the 100 metres. Yes, I felt confident that I could build a working microprocessor-based system quicker than any of the athletes. You see, comparisons all depend on the test that we have decided to use. Anyone can be World champion. It’s only a matter of choosing the tests well enough. With that in mind, here are a few popular speed comparisons.

MIPS (millions of instructions per second)

This appears an easy measurement to take. It is simply a matter of multiplying the number of clock cycles in a second by the clock cycles taken to complete an instruction.

The current Athlon for example can run at 2 GHz or 2000 MHz. It can perform up to 9 instructions per clock cycle so its number of instructions per second is simply 2×109×9=18 000 million cycles per second.