Information Technology Reference
In-Depth Information
number of holding places for data known as registers that may be used to keep
an instruction, a storage address, or any other kind of data. As in the case of
our file clerk, some instructions tell the computer to copy words from memory
to the central processor's registers. Other instructions perform some numerical
or logical operation on this data and place the result in one of the processor's
registers. The instructions accomplish this by opening control gates that allow
the data to flow from location to location within the computer. These control
gates are on the paths between the memory storage cells and the logic gates.
Between each register and each specific processing element are data paths with
gates activated by each instruction. In the architecture of most processors and
in their associated instruction sets, this linking of instructions to specific data
paths is created using a structure of branching paths called a decision tree . Data
for arithmetic operations are sent one way, while data for logical operations
are sent another way.
In an actual instruction, branch decisions are represented by 1s and 0s in dif-
ferent places in the instruction (see Fig. 3.3 ). For example, we might choose the
first bit to be 1 for an arithmetic operation and 0 for a logical operation. The sec-
ond bit could be 1 for an ADD in the arithmetic branch or for an AND gate in the
logic branch. If we have an eight-bit instruction set, the remaining six bits could
be used to specify the three-bit addresses of two registers. Thus the instruction
word 11010001 could mean “Use the arithmetic unit to add the number in regis-
ter 010 to the number in register 001.” Modern instruction sets are more compli-
cated but follow similar principles. For the first computers, programmers had to
carefully think through how the desired sequence of operations translated into
the actual setting of the switches. The use of machine code - the representation of
instructions that were implemented in the computer hardware as binary num-
bers - was the first step in liberating the programmer from needing to know all
the details of the hardware architecture. Writing programs in machine code is
the first step up the software abstraction layers.
A stored-program computer is one that keeps its instructions, as well as its
data, in its memory. Because it was Maurice Wilkes and the EDSAC who first
proved the feasibility of such an architecture, it is not surprising that many
of the early ideas of programming and software development came from the
Cambridge team. The EDSAC ran its first program on 6 May 1949. The program,
which was the calculation and printing of a table of squares from 0 to 99, ran
for two minutes and thirty-five seconds. Within a year, the EDSAC was provid-
ing a programming service for the entire university. However, as Wilkes had
discovered, programming correctly in machine code was difficult. He therefore
introduced a more programmer-friendly notation for the machine instructions.
For example, the EDSAC instruction “Add the short number in memory loca-
tion 25” was stored as the binary string:
1111111100010110011001000110111000000000101101000000000
0011011000000000011010000000101000010110100001010101100
0100111100101100000111110010011110000100000111110110010
0001011100000001000100110010010011101000111111001111111
1111111111111111111001001110000111001000110010111011001
1011001101111100000101011111011111110010110110011001000
0100011110000111000011111010100000101000101010111000101
1101011101110111010011101011011111001100110100111011101
1000011110010110111110000011010010111011010010111011010
0101101110001110100111010111000101110101110111011101001
1101011101011010011000001101001011101101001011101101010
0101110111001111110011101101111010011000011100010010111
0111001111101001110010111010011000011100010010111011100
1111010001110011111010011100101110100110000111000100101
1101110010110010111011001011101110100110010111110001110
1000101110110010011000011110100110000101011101100010111
0011111001101011101110010110111111001001100001111010011
0000101011101100011110111111011011101101110010111011101
1101000101110110111011011111110100110010110111010001111
0011101010101101101111001111101001100001110001111010110
0000000000000000000000000001111100010001100000000110100
0001100000000000000100000000011011000100100000000000100
0100110010000000100100010001000001000000100101000100011
0000000100110000000000000000010000000001010110001000000
1100000001001100000000000000000100000000011000000010001
0000000010011000001100000000000001000000011100000010001
1000000000001011000000101100000000000001000100010000010
0010000000000010000100000000000000000100000001000100011
0000000000010000100000101000100000000000100000001000100
0000000000100100001000101000000001010000100000010000010
0000001001000110000000000011000011001010000000000000100
0000000000000000000001000000000001000111100011111111100
0000000000110100000000000001101100000000000001101000000
0000000001101010000000000000110111000000000000011011001
0000000000110000001001001011010000000000010000000011101
0011001011110011111010010111011000110110110111000011101
0011101110011100001110010110100111011101110100110011001
0100001101001001000010100100
Fig. 3.3. This illustration shows the
binary code of the “Hello world”
program generated by the GNU
CC compiler for a modern Intel
microprocessor.
11100000000110010
This was abbreviated as:
A 25 S
where A stood for “add,” 25 was the decimal address of the memory location,
and S indicated that a “short” number was to be used. David Wheeler ( B.3.2 ),
Search WWH ::




Custom Search