WELCOME

WELCOME !!!
Powered By Blogger

how do you find my blog?

comment

hello

Search This Blog

Pages

Monday, May 17, 2010

Assessment/comment for Group2(report)


POSITIVE:

Deliberation of report:
* there is a sense through their explanation.
*example are there also.




NEGATIVE:

voice is not clear.
more on reading except kuya delalamon.

Friday, May 14, 2010

Character-Map Terminals
Three kinds of terminals are in common use: character-map terminals, bitmap
terminals, and RS-232-C terminals. They all can use any keyboard type, but
they differ in the way the computer communicates with them and how the output
is handled. We will now briefly describe each kind.
On a personal computer, there are two ways to organize the output to the
screen: a character map and a bit map. Figure 2-6 shows how a character map is
used to display output on the monitor. (The keyboard is treated as a completely
separate device.) On the serial communication board is a chunk of memory,
called the video memory, as well as some electronics for accessing the bus and
generating video signals.
CPU
Character
Attribute
Analog video signal
Monitor
ABC
Bus
Video
RAM
Main
memory
Video
board
A2B2C2
Figure 2-6. Terminal output on a personal computer.
To display characters, the CPU copies them to the video memory in alternate
bytes. Associated with each character is an attribute byte that describes how that
character is to be displayed. Attributes can include its color, intensity, whether it
is blinking, and so on. Thus a screen image of 25 ´ 80 characters requires 4000
bytes of video memory, 2000 for the characters and 2000 for the attributes. Most
boards have more memory to hold multiple screen images.
The job of the video board is to repeatedly fetch characters from the video
RAM and generate the necessary signal to drive the monitor. An entire line of
characters is fetched at once so the individual scan lines can be computed. This
signal is a high-frequency analog signal that controls the scanning of the electron
beam that paints the characters on the screen. Because the board outputs a video
signal, the monitor must be within a few meters of the computer to prevent distortion.
Bit-map Terminals
A variation on this idea is to have the screen not be regarded as a 25 ´ 80 array
of characters, but as an array of picture elements, called pixels. Each pixel is
either on or off. It represents one bit of information. On personal computers the
SEC. 2.4 INPUT/OUTPUT 97
screen may contain as few as 640 ´ 480 pixels, but more commonly 800 ´ 600 or
more. On engineering workstations, the screen is typically 1280 ´ 960 pixels or
more. Terminals using a bit map rather than a character map are called bit-map
terminals. All modern video boards can operate either as character-map terminals
or bit-map terminals, under software control.
The same general idea is used as in Fig. 2-6, except that the video RAM is
just seen as a big bit array. The software can set any pattern it wants there, and
that is displayed instantly. To draw characters, the software might decide to allocate,
for example, a 9 by 14 rectangle for each character and fill in the necessary
bits to make the character appear. This approach allows the software to create
multiple fonts and intermix them at will. All the hardware does is display the bit
array. For color displays, each pixel is 8, 16, or 24 bits.
Bit-map terminals are commonly used to support displays containing several
windows. A window is an area of the screen used by one program. With multiple
windows, it is possible to have several programs running at the same time, each
one displaying its results independent of the other ones.
Although bit-map terminals are highly flexible, they have two major disadvantages.
First, they require a considerable amount of video RAM. The most
common sizes these days are 640 ´ 480 (VGA), 800 ´ 600 (SVGA), 1024 ´ 768
(XVGA), and 1280 ´ 960). Notice that all of these have an aspect ratio
(width:height) of 4:3, to conform to the current ratio for television sets. To get
true color, 8 bits are needed for each of the three primary colors, or 3 bytes/pixel.
Thus a 1024 ´ 768 display, requires 2.3 MB of video RAM.
As a result of this large requirement, some computers compromise by using
an 8-bit number to indicate the color desired. This number is then used as an
index into a hardware table, called the color palette that contains 256 entries,
each holding a 24-bit RGB value. Such a design, called indexed color, reduces
the memory video RAM memory requirements by 2/3, but allows only 256 colors
on the screen at once. Usually, each window on the screen has its own mapping,
but with only one hardware color palette, often when multiple windows are
present on the screen, only the current one has its colors rendered correctly.
The second disadvantage of a bit-map display is performance. Once application
programmers realize that they can control every pixel in both space and time,
they want to do it. Although data can be copied from the video RAM to the monitor
without going over the main system bus, getting data into the video RAM does
use the system bus. To display full-screen, full-color multimedia on a 1024 ´ 768
display requires copying 2.3 MB of data to the video RAM for every frame. For
full-motion video, a rate of at least 25 frame/sec is needed, for a total data rate of
57.6 MB/sec. This load is far more than what the (E)ISA bus can handle, so
high-performance video cards on IBM PCs need to be PCI cards, and even then,
major compromises are required.
A related performance problem is how to scroll the screen. One way is copying
all the bits in software, but doing this puts a gigantic load on the CPU. Not
98 COMPUTER SYSTEMS ORGANIZATION CHAP. 2
surprisingly, many video cards are equipped with special hardware for moving
parts of the screen by changing base registers rather than copying.
RS-232-C Terminals
Dozens of companies make computers and many others make terminals (especially
for mainframes). To allow (almost) any terminal to be used with (almost)
any computer, a standard computer-terminal interface, called RS-232-C, has been
developed by the Electronics Industries Association (EIA). Any terminal that
supports the RS-232-C interface can be connected to any computer that also supports
this interface.
RS-232-C terminals have a standardized 25-pin connector on them. The RS-
232-C standard defines the mechanical size and shape of the connector, the voltage
levels, and the meaning of each of the signals on the pins.
When the computer and the terminal are far apart, it is frequently the case that
the only practical way to connect them is over the telephone system. Unfortunately,
the telephone system is not capable of transmitting the signals required
by the RS-232-C standard, so a device called a modem (modulator-demodulator)
has to be inserted between the computer and the telephone and also between the
terminal and the telephone to perform signal conversion. We will study modems
shortly.
Figure 2-7 shows the placement of the computer, modems, and terminal when
a telephone line is used. When the terminal is close enough to the computer that it
can be wired-up directly, modems are not used, but the same RS-232-C connectors
and cables are still used, although those pins related to modem control are not
needed.
To communicate, the computer and terminal each contain a chip called a
UART (Universal Asynchronous Receiver Transmitter), as well as logic to
access the bus. To display a character, the computer fetches a character from its
main memory and presents it to the UART, which then shifts it out onto the RS-
232-C cable bit-for-bit. In effect, the UART is really a parallel-to-serial converter,
since an entire character (1 byte) is given to it at once, and it outputs the
bits one at a time at a specific rate. It also adds a start bit and a stop bit to each
character to delimit the beginning and the end of the character (at 110 bps, 2 stop
bits are used).
In the terminal, another UART receives the bits and rebuilds the entire character,
which is then displayed on the screen. Input from the terminal’s keyboard
goes through a parallel-to-serial conversion in the terminal and is then reassembled
by the UART in the computer.
The RS-232-C standard defines almost 25 signals, but in practice, only a few
are used (and most of those can be omitted when the terminal is wired directly to
the computer without modems). Pins 2 and 3 are for transmitting and receiving
data, respectively. Each pin handles a one-way bit stream, in opposite directions.
SEC. 2.4 INPUT
INPUT/OUTPUT 95
(a)
(b)
y
z
Rear glass plate
Liquid crystal
Rear
electrode
Rear
polaroid
Front glass plate
Front electrode
Front polaroid
Bright
Dark
Light
source
Notebook computer
􀀀
@ @€ €À À􀀀 Figure 2-5. (a) The construction of an LCD screen. (b) The grooves on the rear
and front plates are perpendicular to one another.
display, for example, the rear electrode might have 640 vertical wires and the
front one might have 480 horizontal ones. By putting a voltage on one of the vertical
wires and then pulsing one of the horizontal ones, the voltage at one selected
pixel position can be changed, making it go dark briefly. By repeating this pulse
with the next pixel and then the next one, a dark scan line can be painted, analogous
to how a CRT works. Normally, the entire screen is painted 60 times a
second to fool the eye into thinking there is a constant image there, again, the
same way as a CRT.
The other scheme in widespread use is the active matrix display. It is considerably
more expensive but it gives a better image so it is winning ground.
Instead of just having two sets of perpendicular wires, it has a tiny switching element
at each pixel position on one of the electrodes. By turning these on and off,
an arbitrary voltage pattern can be created across the screen, allowing for an arbitrary
bit pattern.
So far we have described how a monochrome display works. Suffice it to say
that color displays uses the same general principles as monochrome displays, but
that the details are a great deal more complicated. Optical filters are used to
separate the white light into red, green, and blue components at each pixel position
so these can be displayed independently. Every color can be built up from a
linear superposition of these three primary colors.
Flat Panel Displays
CRTs are far too bulky and heavy to be used in notebook computers, so a
completely different technology is needed for their screens. The most common
one is LCD (Liquid Crystal Display) technology. It is highly complex, has
many variations, and is changing rapidly, so this description will, of necessity, be
brief and greatly simplified.
Liquid crystals are viscous organic molecules that flow like a liquid but also
have spatial structure, like a crystal. They were discovered by an Austrian botanist
(Rheinitzer) in 1888, and first applied to displays (e.g., calculators, watches) in
the 1960s. When all the molecules are lined up in the same direction, the optical
properties of the crystal depend on the direction and polarization of the incoming
light. Using an applied electric field, the molecular alignment, hence the optical
properties, can be changed. In particular, by shining a light through a liquid crystal,
the intensity of the light exiting from it can be controlled electrically. This
property can be exploited to construct flat panel displays.
An LCD display screen consists of two parallel glass plates between which is
a sealed volume containing a liquid crystal. Transparent electrodes are attached
to both plates. A light behind the rear plate (either natural or artificial) illuminates
the screen from behind. The transparent electrodes attached to each plate
used to create electric fields in the liquid crystal. Different parts of the screen get
different voltages, to control the image displayed. Glued to the front and rear of
the screen are polaroids because the display technology requires the use of polarized
light. The general setup is shown in Fig. 2-5(a).
Although many kinds of LCD displays are in use, we will now consider one
particular kind of display, the TN (Twisted Nematic) display as an example. In
this display, the rear plate contains tiny horizontal grooves and the front plate contains
tiny vertical grooves, as illustrated in Fig. 2-5(b). In the absence of an electric
field, the LCD molecules tend to align with the grooves. Since the front and
rear alignments differ by 90 degrees, the molecules (and thus the crystal structure)
twist from rear to front.
At the rear of the display is a horizontal polaroid. It only allows in horizontally
polarized light. At the front of the display is a vertical polaroid. It only
allows vertically polarized light to pass through. If there were no liquid present
between the plates, horizontally polarized light let in by the rear polaroid would
be blocked by the front polaroid, making the screen uniformly black.
However the twisted crystal structure of the LCD molecules guides the light
as it passes and rotates its polarization, making it come out horizontally. Thus in
the absence of an electric field, the LCD screen is uniformly bright. By applying
a voltage to selected parts of the plate, the twisted structure can be destroyed,
blocking the light in those parts.
Two schemes are commonly used for applying the voltage. In a (low-cost)
passive matrix display, both electrodes contain parallel wires. In a 640 ´ 480
CRT Monitors
A monitor is a box containing a CRT (Cathode Ray Tube) and its power
supplies. The CRT contains a gun that can shoot an electron beam against a phosphorescent
screen near the front of the tube, as shown in Fig. 2-4(a). (Color monitors
have three electron guns, one each for red, green and blue.) During the horizontal
scan, the beam sweeps across the screen in about 50 msec, tracing out an
almost horizontal line on the screen. Then it executes a horizontal retrace to get
back to the left-hand edge in order to begin the next sweep. A device like this that
produces an image line by line is called a raster scan device.
(a) (b)
Electron gun
Grid
Screen
Spot on
screen
Vacuum
Vertical
deflection
plate
Horizontal scan
Vertical retrace Horizontal retrace
Figure 2-4. (a) Cross section of a CRT. (b) CRT scanning pattern.
Horizontal sweeping is controlled by a linearly increasing voltage applied to
the horizontal deflection plates placed to the left and right of the electron gun.
Vertical motion is controlled by a much more slowly linearly increasing voltage
applied to the vertical deflection plates placed above and below the gun. After
somewhere between 400 and 1000 sweeps, the voltages on the vertical and horizontal
deflection plates are rapidly reversed together to put the beam back in the
upper left-hand corner. A full-screen image is normally repainted between 30 and
60 times a second. The beam motions are shown in Fig. 2-4(b). Although we
have described CRTs as using electric fields for sweeping the beam across the
screen, many models use magnetic fields instead of electric ones, especially in
high-end monitors.
To produce a pattern of dots on the screen, a grid is present inside the CRT.
When a positive voltage is applied to the grid, the electrons are accelerated, causing
the beam to hit the screen and make it glow briefly. When a negative voltage
is used, the electrons are repelled, so they do not pass through the grid and the
screen does not glow. Thus the voltage applied to the grid causes the corresponding
bit pattern to appear on the screen. This mechanism allows a binary electrical
signal to be converted into a visual display consisting of bright and dark spots.
94
COMPUTER SYSTEMS ORGANIZATION CHAP. 2
􀀀
􀀀





Memory bus
CPU PCI
bridge
SCSI
controller
SCSI
disk
Network
controller
Video
controller
Printer
controller
Sound
card ISA Modem
bridge
SCSI
scanner
Main
SCSI memory
bus
PCI bus
ISA bus
cache
Figure 2-3. A typical modern PC with a PCI bus and an ISA bus. The modem
and sound card are ISA devices; the SCSI controller is a PCI device.
Keyboards
Keyboards come in several varieties. The original IBM PC came with a keyboard
that had a snap-action switch under each key that gave tactile feedback and
made a click with the key was depressed far enough. Nowadays, the cheaper keyboards
have keys that just make mechanical contact when depressed. Better ones
have a sheet of elastometric material (a kind of rubber) between the keys and the
underlying printed circuit board. Under each key is a small dome that buckles
when depressed far enough. A small spot of conductive material inside the dome
closes the circuit. Some keyboards have a magnet under each key that passes
through a coil when struck, thus inducing a current that can be detected. Various
other methods, both mechanical and electromagnetic, are also in use.
On personal computers, when a key is depressed, an interrupt is generated and
the keyboard interrupt handler (a piece of software that is part of the operating
system) is started. The interrupt handler reads a hardware register inside the keyboard
controller to get the number of the key (1 through 102) that was just
depressed. When a key is released, a second interrupt is caused. Thus if a user
depresses the SHIFT key, then depresses and releases the M key, then releases the
SHIFT key, the operating system can see that the user wants an upper case ‘‘M’’
rather than a lower case ‘‘m.’’ Handling of multikey sequences involving SHIFT,
CTRL, and ALT is done entirely in software (including the infamous CTRLALT-
DEL key sequence that is used to reboot all IBM PCs and clones
INPUT/OUTPUT 91
was to design a new and faster bus for the next model. Because nobody ever
moved I/O devices from an old model to a new one, this approached worked fine.
However, in the PC world, people often upgraded their CPU but wanted to
move their printer, scanner, and modem to the new system. Also, a huge industry
had grown up around providing a vast range of I/O devices for the IBM PC bus,
and this industry had exceedingly little interest in throwing out its entire investment
and starting over. IBM learned this the hard way when it brought out the
successor to the IBM PC, the PS/2 range. The PS/2 had a new, and faster bus, but
most clone makers continued to use the old PC bus, now called the ISA (Industry
Standard Architecture) bus. Most disk and I/O device makers also continued to
make controllers for it, so IBM found itself in the peculiar situation of being the
only PC maker that was no longer IBM compatible. Eventually, it was forced
back to supporting the ISA bus. As an aside, please note that ISA stands for
Instruction Set Architecture in the context of machine levels whereas it stands for
Industry Standard Architecture in the context of buses.
Nevertheless, despite the market pressure not to change anything, the old bus
really was too slow, so something had to be done. This situation led to other companies
developing machines with multiple buses, one of which was the old ISA
bus, or its backward-compatible successor, the EISA (Extended ISA) bus. The
most popular of these now is the PCI (Peripheral Component Interconnect)
bus. It was designed by Intel, but Intel decided to put all the patents in the public
domain, to encourage the entire industry (including its competitors) to adopt it.

The PCI bus can be used in many configurations, but a typical one is illustrated
in Fig. 2-3. Here the CPU talks to a memory controller over a dedicated
high-speed connection. The controller talks to the memory and to the PCI bus
directly, so CPU-memory traffic does not go over the PCI bus. However, highbandwidth
(i.e., high data rate) peripherals, such as SCSI disks, can connect to the
PCI bus directly. In addition, the PCI bus has a bridge to the ISA bus, so that ISA
controllers and their devices can still be used. A machine of this design would
typically contain three or four empty PCI slots and another three or four empty
ISA slots, to allow customers to plug in both old ISA I/O cards (usually for slow
devices) and new PCI I/O cards (usually for fast devices).
Many kinds of I/O devices are available today. A few of the more common
ones are discussed below.

2.4.2 Terminals

Computer terminals consist of two parts: a keyboard and a monitor. In the
mainframe world, these parts are often integrated into a single device and attached
to the main computer by a serial line or over a telephone line. In the airline reservation,
banking, and other mainframe-oriented industries, these devices are still in
widespread use. In the personal computer world, the keyboard and monitor are
independent devices. Either way, the technology of the two parts is the
COMPUTER SYSTEMS ORGANIZATION CHAP. 2
Monitor
Keyboard Floppy
disk drive
Hard
disk drive
Hard
disk
controller
Floppy
disk
controller
Keyboard
controller
Video
CPU Memory controller
Bus
Figure 2-2. Logical structure of a simple personal computer.
The job of a controller is to control its I/O device and handle bus access for it.
When a program wants data from the disk for example, it gives a command to the
disk controller, which then issues seeks and other commands to the drive. When
the proper track and sector have been located, the drive begins outputting the data
as a serial bit stream to the controller. It is the job of the controller to break the
bit stream up into units, and write each unit into memory, as it is assembled. A
unit is typically one or more words. A controller that reads or writes data to or
from memory without CPU intervention is said to be performing Direct Memory
Access, better known by its acronym DMA. When the transfer is completed, the
controller normally causes an interrupt, forcing the CPU to suspend running its
current program and start running a special procedure, called an interrupt
handler, to check for errors, take any special action needed, and inform the
operating system that the I/O is now finished. When the interrupt handler is finished,
the CPU continues with the program that was suspended when the interrupt
occurred.
The bus is not only used by the I/O controllers, but also by the CPU for fetching
instructions and data. What happens if the CPU and an I/O controller want to
use the bus at the same time? The answer is that a chip called a bus arbiter
decides who goes next. In general, I/O devices are given preference over the
CPU, because disks and other moving devices cannot be stopped, and forcing
them to wait would result in lost data. When no I/O is in progress, the CPU can
have all the bus cycles for itself to reference memory. However, when some I/O
device is also running, that device will request and be granted the bus when it
needs it. This process is called cycle stealing and it slows down the computer.
This design worked fine for the first personal computers, since all the components
were roughly in balance. However, as the CPUs, memories, and I/O devices
got faster, a problem arose: the bus could no longer handle the load
presented. On a closed system, such as an engineering workstation, the
INPUT/OUTPUT
As we mentioned at the start of this chapter, a computer system has three
major components: the CPU, the memories (primary and secondary), and the I/O
(Input/Output) equipment such as printers, scanners, and modems. So far we
have looked at the CPU and the memories. Now it is time to examine the I/O
equipment and how it is connected to the rest of the system.
2.4.1 Buses
Physically, most personal computers and workstations have a structure similar
to the one shown in Fig. 2-1. The usual arrangement is a metal box with a large
printed circuit board at the bottom, called the motherboard (parentboard, for the
politically correct). The motherboard contains the CPU chip, some slots into
which DIMM modules can be clicked, and various support chips. It also contains
a bus etched along its length, and sockets into which the edge connectors of I/O
boards can be inserted. Sometimes there are two buses, a high-speed one (for
modern I/O boards) and a low-speed one (for older I/O boards).
SCSI controller
Sound card
Modem
Edge connector
Card cage
Figure 2-1. Physical structure of a personal computer.
The logical structure of a simple low-end personal computer is shown in
Fig. 2-2. This one has a single bus used to connect the CPU, memory, and I/O
devices; most systems have two or more buses. Each I/O device consists of two
parts: one containing most of the electronics, called the controller, and one containing
the I/O device itself, such as a disk drive. The controller is usually contained
on a board plugged into a free slot, except for those controllers that are not
optional (such as the keyboard), which are sometimes located on the motherboard.
Even though the display (monitor) is not an option, the video controller is sometimes
located on a plug-in board to allow the user to choose between boards with
or without graphics accelerators, extra memory, and so on. The controller connects
to its device by a cable attached to a connector on the back of the box