Lesson 1

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

Please not that the source from which this document was derived is

currently unknown and thus not citable.


COMPUTING SYSTEMS

“The heart of any computing system is its central processing unit, or CPU. The CPU controls
the operation of the entire system, performs the arithmetic and logic operations, and stores
and retrieves instructions and data. The instructions and data are stored in a high-speed
memory unit, and the control unit fetches these instructions from memory, decodes them, and
directs the system to execute the operations indicated by the instructions. Those operations
that are arithmetical or logical in nature are carried out using special registers and circuits of
the arithmetic-logic unit (ALU) of the CPU.

The memory unit is called the internal or main or primary memory of the computer system.
It is used to store the instructions and data of the programs being executed. Most computing
systems also contain components that serve as external or auxiliary or secondary memory.
Common forms of this type of memory are magnetic disks and magnetic tapes. These
peripheral devices provide long-term storage for large collections of information.

Other peripherals are used to transmit instructions, data and computed results between the
user and the CPU. These are the input/output devices. Their function is to convert
information from an external form understandable to the user to a form that can be processed
by the computer system, and vice versa.

MEMORY ORGANIZATION

Similar to a microprocessor, a memory chip is an integrated circuit (IC) made of


millions of transistors (a device that is used to conduct the flow of electricity) and
capacitors (a device used to store current). In the most common form of computer
memory, dynamic random access memory (DRAM), a transistor and a capacitor are
paired to create a memory cell, which represents a single bit of data. The capacitor holds
the bit of information -- a 0 or a 1. The transistor acts as a switch that lets the control
circuitry on the memory chip read the capacitor or change its state.

A capacitor is like a small bucket that is able to store electrons. To store a 1 in the
memory cell, the bucket is filled with electrons. To store a 0, it is emptied. The problem
with the capacitor's bucket is that it has a leak. In a matter of a few milliseconds a full
bucket becomes empty. Therefore, for dynamic memory to work, either the CPU or the
memory controller has to come along and recharge all of the capacitors holding a 1
before they discharge. To do this, the memory controller reads the memory and then
writes it right back. This refresh operation happens automatically thousands of times per
second.

The capacitor in a dynamic RAM memory cell is like a leaky bucket.


It needs to be refreshed periodically or it will discharge to 0.

This refresh operation is where dynamic RAM gets its name. Dynamic RAM has to be
dynamically refreshed all of the time or it forgets what it is holding. The downside of all
of this refreshing is that it takes time and slows down the memory.
Please not that the source from which this document was derived is
currently unknown and thus not citable.
Memory cells are etched onto a silicon wafer in an array of columns (bitlines) and rows
(wordlines). The intersection of a bitline and wordline constitutes the address of the
memory cell.

Memory is made up of bits arranged in a two-dimensional grid.


In this figure, red cells represent 1s and white cells represent 0s.
In the animation, a column is selected and then rows are charged to write data into the specific
column.

DRAM works by sending a charge through the appropriate column (CAS) to activate the
transistor at each bit in the column. When writing, the row lines contain the state the
capacitor should take on. When reading, the sense-amplifier determines the level of
charge in the capacitor. If it is more than 50 percent, it reads it as a 1; otherwise it reads it
as a 0. The counter tracks the refresh sequence based on which rows have been accessed
in what order. The length of time necessary to do all this is so short that it is expressed in
nanoseconds (billionths of a second). A memory chip rating of 70ns means that it takes
70 nanoseconds to completely read and recharge each cell.

Memory cells alone would be worthless without some way to get information in and out
of them. So the memory cells have a whole support infrastructure of other specialized
circuits. These circuits perform functions such as:

• Identifying each row and column (row address select and column address
select)
• Keeping track of the refresh sequence (counter)
• Reading and restoring the signal from a cell (sense amplifier)
• Telling a cell whether it should take a charge or not (write enable)

Other functions of the memory controller include a series of tasks that include
identifying the type, speed and amount of memory and checking for errors.

Static RAM uses a completely different technology. In static RAM, a form of flip-flop
holds each bit of memory. A flip-flop for a memory cell takes four or six transistors along
with some wiring, but never has to be refreshed. This makes static RAM significantly
faster than dynamic RAM. However, because it has more parts, a static memory cell
takes up a lot more space on a chip than a dynamic memory cell. Therefore, you get less
memory per chip, and that makes static RAM a lot more expensive.

So static RAM is fast and expensive, and dynamic RAM is less expensive and slower. So
static RAM is used to create the CPU's speed-sensitive cache, while dynamic RAM forms
the larger system RAM space.

In summary then, the devices that comprise the memory unit of a computer are two state
devices. If one of the states is interpreted as 0 and the other as 1, then it is natural to use a
binary scheme, using only the two binary digits (bits) 0 and 1 to represent information in a
Please not that the source from which this document was derived is
currently unknown and thus not citable.
computer. These two-state devices are organized into groups called bytes, each of which
contains a fixed number of these devices, usually eight and thus can store a fixed number of
bits. Memory is commonly measured in bytes, and a block of 210 = 1024 bytes is called 1K of
memory. Thus, a 512K memory usually refers to a memory that consists of 512 x 210
= 210 x 29 = 219 = 524,288 bytes.

A larger grouping of bits and bytes is into words. Word sizes vary with computers, but
common sizes are 16 bits = 2 bytes and 32 bits = 4 bytes. Each word or byte is identified by
an address and can be directly accessed using this address. This makes it possible to store
information in a specific memory location and then to retrieve it later.

NUMBER SYSTEMS

The number system that we are accustomed to using is a decimal or base-10 number system,
which uses the digits 0,1,2,3,4,5,6,7,8 and 9. The significance of these digits in a numeral
depends on the position that they occupy in that numeral. For example, in the numeral

485

the digit 4 is interpreted as


4 hundreds
and the digit 8 as
8 tens
and the digit 5 as
5 ones

Thus, the numeral 485 represents the number four-hundred eighty-five and can be written in
expanded form as

(4x100) + (8x10) + (5x1)


(4x102) + (8x101) + (5x100)

The digits that appear in the various positions of a decimal (base-10) numeral thus are
coefficients of powers of 10.

Similar positional number systems can be devised using numbers other than 10 as a
base. The binary number system uses 2 as the base and has only two digits, 0 and 1. For
example, the binary numeral

1012

can be written in expanded form (using decimal notation) as


(1x22) + (0x21) + (1x20)

that is, the binary numeral 101 has the decimal value

4+0+1=5
Please not that the source from which this document was derived is
currently unknown and thus not citable.

Two other nondecimal numeration systems are important in the study of computer systems:
octal and hexadecimal. The octal system is a base-8 system and uses the eight digits
0,1,2,3,4,5,6 and 7. In an octal numeral such as

17038

the digits are coefficients of powers of 8; this numeral is therefore an abbreviation for the
expanded form

(1x83) + (7x82) + (0x81) + (3x80)

and thus has the decimal value


512 + 448 + 0 + 3 = 963

A hexadecimal system uses a base of 16 and the digits 0,1,2,3,4,5,6,7,8,9,A(10), B (11),


C(12), D(13), E(14), and F(15). The hexadecimal numeral

5E416

has expanded form

(5x162) + (14x161) + (4x160)

which has the decimal value

1280 + 224 + 4 = 1508

DATA STORAGE

INTEGERS: When an integer value must be stored in the computer’s memory, the binary
representation of that value is typically stored in one memory word. Consider that the integer
value 58 is to be stored in a computer whose word size is 16 bits. A memory word is
selected, and a sequence of 16 bits formed from the binary representation 111010 of 58 is
stored there

Memory

0000000000111010

Negative integers must be stored in a binary form in which the sign of the integer is part of
the representation. There are several ways that this can be done, but one of the most common
is the two’s complement representation. In this scheme, positive integers are represented in
binary form as described, with the leftmost bit set to 0 to indicate that the value is positive.
The representation of a negative integer –n is obtained by first finding the binary
representation of n, complementing it – that is, changing each 0 to 1 and each 1 to 0 – and
Please not that the source from which this document was derived is
currently unknown and thus not citable.
then adding 1 to the result. For example, the two’s complement representation of –58 using
16 bits is obtained as follows:

1. Represent 58 by a 16-bit binary numeral:


i. 0000000000111010
2. Complement this bit string:
i. 1111111111000101
3. Add 1:
i. 1111111111000110

Note that the leftmost bit in this two’s complement representation of a negative integer is
always 1, indicating that the number is negative.
The fixed word size limits the range of the integers that can be stored. For example, the
largest positive integer that can be stored in a 16-bit word is:

01111111111111112 = 215 – 1 = 32,767

and the smallest negative integer is

10000000000000002 = -215 = -32,768

REAL NUMBERS:
Numbers that contain decimal points are called real numbers or floating-point numbers. In
the decimal representation of such numbers, each digit is the coefficient of some power of 10.
Digits to the left of the decimal point are coefficients of nonnegative powers of 10, and those
to the right are coefficients of negative powers of 10. For example, the decimal numeral
56.317 can be written in expanded form as

(5x101) + (6x100) + (3x10-1) + (1x10-2) + (7x10-3)

or equivalently, as
(5 x10) + (6x1) + (3x1/10) + (1 x 1/100) + (7 x 1/1000)

Digits in the binary representation of a real number are coefficients of powers of two. Those
to the left of the binary point are coefficients of nonnegative powers of two, and those to the
right are coefficients of negative powers of two. For example, the expanded form of 110.101
is

(1x22) + (1x21) + (0x20) + (1x2-1) + (0x2-2) + (1x2-3)

and thus has the decimal value

4 + 2 + 0 + ½ + 0 + 1/8 = 6.625

There is some variation in the schemes used for storing real numbers in computer memory,
but one common method is illustrated by the following. The binary representation
Please not that the source from which this document was derived is
currently unknown and thus not citable.
110.1012

of the real number 6.625 can also be written as

0.1101012 x 23

Typically, one part of a memory word (or words) is used to store a fixed number of bits of
the mantissa or fractional part, 0.1101012 and the other part to store the exponent, 3 = 112.
For example, if the leftmost eleven bits in a 16-bit word are used for the mantissa and the
remaining five bits for the exponent, 6.625 can be stored as

0110101000000011

Mantissa exponent

Boolean and Character Values

Computers store and process not only numeric data but also Boolean or logical data (false or
true), character data, and other types of nonnumeric information. Consider the logical values
true and false. Since there are only two logical values, the logical value false can be
represented as the integer 0, and the logical value true can be represented as the integer 1.
Character values are represented in a similar fashion. Each character is represented by a
unique numeric code. Several standard coding schemes have been developed, such as
ASCII (American Standard Code for Information Interchange) and EBCDIC (Extended
Binary Coded Decimal Interchange Code). These binary codes are used to represent
characters internally. A byte (eight bits) can store the binary representation of one
character, so that a 16-bit word (two bytes) can store two characters. For example, the
character string HI can be stored in a single 16-bit word with the code for H in the left byte
and the code for I in the right byte. Using ASCII code, these values are stored as follows:

0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 1

H
I
Please not that the source from which this document was derived is
currently unknown and thus not citable.
Instruction Processing

Program instructions for processing data must also be stored in memory. As an example,
suppose that three values, 8 = 10002 , 24 = 110002 , and 58 = 1110102, have been stored in
memory locations with addresses 4, 5, and 6 and that we want to multiply the first two
values, add the third, and store the result in memory word 7. (Remember, all locations in
memory have a unique address so that the CPU can access it for storage and retrieval!)

Address Memory
0

4 value = 8
0000000000001000

5 value = 24
0000000000011000

6 value = 58
0000000000111010

7 result goes here

To perform this computation, the following instructions must be executed:


1. Fetch the contents of memory word 4 and load it into the accumulator register of the
ALU.
2. Fetch the contents of memory word 5 and compute the product of this value and the
value in the accumulator register.
3. Fetch the contents of memory word 6 and add this value to the value in the
accumulator register.
4. Store the contents of the accumulator register in memory word 7.

In order to store these instructions in computer memory, they must be represented in binary
form. The addresses of the data value present no problem, because they can easily be
converted to binary addresses:
Address 4 = 1002
Address 5 = 1012
Address 6 = 1102
Address 7 = 1112

The operations load, multiply, add, store and other basic machine instructions are represented
by numeric codes, called opcodes; for example,

LOAD = 16 = 000100002
STORE = 17 = 000100012
ADD = 35 = 001000112
Please not that the source from which this document was derived is
currently unknown and thus not citable.
MULTIPLY = 36 = 001001002

Using part of a word to store the opcode and another part for the address of the operand, we
can represent our sequence of instructions in machine language as

1. 0001000000000100 LOAD the value in memory word 4 into the accumulator


2. 0010010000000101 MULTIPLY the accumulator by memory word 5
3. 0010001100000110 ADD memory word 6 to the accumulator
4. 0001000100000111 STORE the value in the accumulator into memory word 7

Opcode Operand

Assignment

1. Convert each of the following binary numerals to base 10:


a. 1001 b. 110010 c. 1000000 d. 1010.10101

2. Convert each of the following octal numerals to base 10:


a. 123 b. 2705 c. 7.2 d. 123.45

3. Convert each of the following hexadecimal numerals to base 10:


a. 12 b. 1AB c. 8.C d. AB.CD

4. Conversion from octal representation to binary representation is easy: We simply replace


each octal digit with its three-bit binary equivalent. For example, to convert 6178 to binary,
replace 6 with 110, 1 with 001, and 7 with 111, to obtain 1100011112. Convert the octal
numerals in (a) and (b) of Exercise 2 to binary numerals.

5. One method for finding the base-b representation of a whole number given in base-10
notation is to divide the number repeatedly by b until a quotient of zero results. The
successive remainders are the digits from right to left of the base-b representation. For
example, the binary representation of 26 is 110102, as the following computation shows:
Please not that the source from which this document was derived is
currently unknown and thus not citable.

Convert each of the following base-10 numerals to I) binary ii) octal, and iii) hexadecimal
a) 27 b) 99 c) 314 d) 5280” (Anon, n.d.)

You might also like