You are on page 1of 46

CHAPTER # 1

William Stallings
1.1 Distinction between computer organization and
computer architecture
Computer architecture refers to those attributes of a system visible to a
programmer or, put another way, those attributes that have a direct impact on
the logical execution of a program.
Examples of architectural attributes include the instruction set, the number
of bits used to represent various data types (e.g., numbers, characters), I/O
mechanisms, and techniques for addressing memory.

Computer organization refers to the operational units and their


interconnections that realize the architectural specifications.
Example of Organizational attributes include those hardware details
transparent to the programmer, such as control signals; interfaces between the
computer and peripherals; and the memory technology used
1.2 Distinction between computer structure and
computer function?

Structure is how devices are interrelated,


while function is the individual characteristics
of each one.
Structure: The way in which the components
are interrelated.
Function: The operation of each individual
component as part of the structure
Function
In general terms, there are only four:
Data processing
Data storage
Data movement
Control

Diagrams see Book


Structure
There are four main structural components:
Central processing unit (CPU)
Main memory
I/O
System interconnection
1.3 What are the four main functions of a computer?

Input
Transferring of information into the system. This may be through a user
input device - i.e. keyboard, mouse, scanner etc.. Or though previously
loaded software/program, cd etc.
Output
Output is the exact opposite of input. Output is the function that allows a
computer to display information, from the system, for the user. This can be
accomplished through the monitor (or other graphical display), printer,
speakers etc.
Processing
This is where the computer actually does the 'work' - manipulating and
controlling data over the entire system.
Storage
Most computers are able to store data both temporarily (in order to
process), but also long-term (i.e., permanently). Storage takes place on
hard-drives or external storage devices.
1.4 List and define the main structural components of
a computer

CPU (Central processing unit): known as processor


as well, its the main computer component,
responsible for the main functions of the computer.
I/O: responsible for the communication between
the computer and the external world.
Data storage: device responsible for data saving.
System bus: responsible for the interconnection
between data storage, CPU and I/O
1.5 List and define the main structural components of
a processor

Control unit: Controls the operation of the CPU and


hence the computer itself.
ALU: make logical and arithmetic operations.
Registers: temporally storage for data while
processor operations.
Internal bus: interconnect control unit, ALU and
registers inside processor
CHAPTER # 1
X86_Processor
1.1.3 Section Review

1. How do assembler and linker work together?


An assembler converts source-code programs from assembly language into
machine language. A linker combines individual files created by an assembler into
a single executable program.
2. How will studying assembly language enhance your
understanding of operating systems?
Assembly language is a good tool for learning how application programs
communicate with the computer's operating system via interrupt
handlers, system calls, and common memory areas. Assembly language
programming also helps when learning how the operating system loads
and executes application programs.
1.1.3 Section Review

3. What is meant by a one-to-many relationship when comparing a high-level


language to machine language?
In a one-to-many relationship, a single statement expands into multiple assembly
language or machine instructions.

4. Explain the concept of portability as it applies to programming languages?


A language whose source programs can be compiled and run on a wide variety of
computer systems is said to be portable.

5. Is the assembly language for x86 processors the same as those for computer
systems such as the Vax or Motorola 68x00?
No. Each assembly language is based on either a processor family or a specific
computer
1.1.3 Section Review

6. Give an example of an embedded systems application?


Some examples of embedded systems applications are automobile fuel and
ignition systems, air-conditioning control systems, security systems, flight control
systems, hand-held computers, modems, printers, and other intelligent
computer peripherals.

7. What is a device driver?


Device drivers are programs that translate general operating system commands
into specific references to hardware details that only the manufacturer knows.

8. Do you suppose type checking on pointer variables is stronger (stricter) in


assembly language or in C and C++?
C++ does not allow a pointer of one type to be assigned to a pointer of another
type. Assembly language has no such restriction regarding pointers.
1.1.3 Section Review

9. Name two types of applications that would be better suited to assembly


language than a high-level language?
Applications suited to assembly language: hardware device driver and embedded
systems and computer games requiring direct hardware access

10. Why would a high-level language not be an ideal tool for writing a program that
directly accesses a particular brand of printer?
A high-level language may not provide for direct hardware access. Even if it does,
awkward coding techniques must often be used, resulting in possible maintenance
problems.

11. Why is assembly language not usually used when writing large application
programs?
Assembly language has minimal formal structure, so structure must be imposed by
programmers who have varying levels of experience. This leads to difficulties
maintaining existing code
1.2.1 Section Review
1. In your own words, describe the virtual machine concept?
Virtual machine concept: Computers are constructed in layers, so that
each layer represents a translation layer from a higher-level instruction
set to a lower-level instruction set.

2. Why dont programmers write application programs in machine


language?
Machine language: It is enormously detailed and consists purely of
numbers. Hard for humans to understand.
Answer:3 True
4. Explain the technique of translation when dealing with languages at
different virtual machine levels?
An entire L1 program is converted into an L0 program by an L0 program
specifically designed for this purpose. Then the resulting L0 program is
executed directly on the computer hardware
1.2.1 Section Review

5. At which level does assembly language appear in the virtual machine


example shown in this section?
Assembly language appears at Level 3.

6. What software permits compiled Java programs to run on almost any


computer?
The Java virtual machine (JVM) allows compiled Java programs to run on
almost any computer.

7. Name the four virtual machine levels named in this section, from lowest
to highest.
Digital logic, instruction set architecture, assembly language, high-level
language.
1.2.1 Section Review

8. Why dont programmers write applications in machine language?


Machine language is difficult for humans to understand, since it provides
no visual clues relating to the instruction syntax
9. Machine language is used at which level of the virtual machine shown
in Figure 11?
Instruction set architecture.
Above this is Level 2, called the instruction set
architecture (ISA). This is the first level at
which users can typically write programs,
although the programs consist of binary
values called machine language

10. Statements at the assembly language level of a virtual machine are translated
into statements at which other level?
Level 2
1.3.7 Section Review

1. Explain the term Least Significant Bit (LSB)?


Least significant bit (bit 0). Bit to the far right.

2. Explain the term Most Significant Bit (MSB)?


Most significant bit (the highest numbered bit). Bit to the far left.

25. What are the hexadecimal and decimal representations of the ASCII
character capital X?
58h and 88d

26. What are the hexadecimal and decimal representations of the ASCII
character capital M?
4Dh and 77d.
1.3.7 Section Review

27. Why was Unicode invented?


To handle international character sets that require more than 256 codes.

28. Challenge: What is the largest value you can represent using a 256-bit
unsigned integer?
2^256 -1

29. Challenge: What is the largest positive value you can represent using a
256-bit signed integer?
+2^255 -1
CHAPTER # 2
William Stallings
2.1 What is a stored program computer

A stored program computer is a computer to use a stored-


program concept.
A stored-program concept is the programming process could
be facilitated if the program could be represented in a form
suitable for storing in memory alongside the data. Then, a
computer could get its instructions by reading them from
memory, and a program could be set or altered by setting the
values of a portion of memory.
2.2. What are the four main components of any
general-purpose computer?

Main memory (M)


I/O equipment (I,O)
Arithmetic-logic unit (CA)
Program control unit (CC)
2.3. At the integrated circuit level, what are the three
principal constituents of a computer system?

Transistors
Resistors
Capacitors
2.4. Explain Moores law.

Gordon Moore-cofounder of Intel.


Moore observed that the number of transistors that could be put on a
single chip was doubling every year and correctly predicted that this pace
would continue into the near future
To the surprise of many, including Moore, the pace continued year after
year and decade after decade. The pace slowed to a doubling every 18
months in the 1970s, but has sustained that rate ever since.
Cost of a chip has remained almost unchanged.
Increase density of components on chip.
Smaller size gives increased flexibility.
Reduces power and cooling requirements.
Fewer interconnection increases reliability.
2.5. List and explain the key characteristics of a
computer family
Similar or identical instruction set: A program that executes on one
machine will also execute on any other.
Similar or identical operation system: The same basic operating system is
available for all family members. In some cases, additional features are
added is the higher-end members.
Increasing speed: The rate of instruction execution increases in going
from lower to higher family members.
Increasing number of I/O ports: In going from lower to higher family
members.
Increasing memory size: In going from lower to higher family members.
Increasing cost: In going from lower to higher family members.
2.6. What is the key distinguishing feature of a
microprocessor?

Clock speeds
Bus width
Number of transistors (microns)
Addressable memory
Virtual memory
CHAPTER # 2
x86_processors
2.1.5 Section Review
1. The central processor unit (CPU) contains registers and what other basic elements?
Control Unit
Arithmetic Logic Unit
The clock.

2. The central processor unit is connected to the rest of the computer system using what
three buses?
Data Bus
Control Bus
Address Bus

3. Why does memory access take more machine cycles than register access?
Conventional memory is outside the CPU, and it responds more slowly to access
requests. Registers are hard-wired inside the CPU.
2.1.5 Section Review
4. What are the three basic steps in the instruction execution cycle?
Fetch
Decode,
Execute.

5. Which two additional steps are required in the instruction execution


cycle when a memory operand is used?
Fetch memory operands
store memory operands

6. During which stage of the instruction execution cycle is the program


counter incremented ?
Fetch.
2.1.5 Section Review
7. When a program runs, what information does the OS read from the filenames
disk directory entry?
Filename, file size, and starting location on the disk. (Most directories also store
the files last modification date and time.)

8. After a program has been loaded into memory, how does it begin execution?
The OS executes a branch (like a GOTO) to the first machine instruction in the
program.

9. Define multitasking
The CPU executes multiple tasks (programs) by rapidly switching from one
program to the next.This gives the impression that all programs are executing at
the same time
2.1.5 Section Review
10. What is the function of the OS scheduler?
The OS scheduler determines how much time to allot to each task, and it
switches between tasks.

11. When the processor switches from one task to another, what values in
the first tasks state must be preserved?
The program counter, the tasks variables, and the CPU registers.

12. What is the duration of a single clock cycle in a 3-GHz processor?


3.33 X 10-10, which is 1.0/3.0 X 109
2.2.5 Section Review
2.2.5 Section Review
2.3.3 Section Review
1. What is the range of addressable memory in protected mode?
The range of addressable memory in protected mode is 4 GB

2. What is the range of addressable memory in real address mode?


The range of addressable memory in real address mode is 1 MB
space.

4. In Real -address mode. convert the following segment-offset


address to a linear address: 0950:0100
09500h+0100h=09600h

5. In Real-address mode. convert the following segment-offset


address to a linear address: 0CD1 :02E0.
0CD10+02E0h=0CFF0h
2.3.3 Section Review
6. In MASMs flat segmentation model, how many bits hold the address of
an instruction or variable?
32-bits

7. In protected mode, which register references the descriptor for the stack
segment?
SS Register

8. In protected mode, which table contains pointers to memory segments


used by a single program?
Local descriptor table

9. In the flat segmentation model, which table contains pointers to at least


two segments?
Global descriptor table
2.3.3 Section Review
10. What is the main advantage to using the paging feature of x86 processors?
The total size of all programs loaded into memory can exceed the amount of
physical memory installed in the computer.
Extra: What is the main disadvantage of using paging feature of x 86 processor?
When the processor begins to execute code that has been paged out of memory it issues a
page fault, causing the page or pages containing the required code or data to be loaded back
into memory.
7. In protected mode, which register references the descriptor for the stack
segment?
SS Register
8. In protected mode, which table contains pointers to memory segments used by a
single program?
Local descriptor table
9. In the flat segmentation model, which table contains pointers to at least two
segments?
Global descriptor table
2.3.3 Section Review

11. Challenge: Can you think of a reason why MS-DOS was not designed to
support protected mode programming?
This is an open-ended question, of course. It is a fact that MS-DOS first
had to run on the 8086/8088 processors, which only supported Real-
address mode. When later processors came out that supported Protected
mode, my guess is that Microsoft wanted MS-DOS to continue to run on
the older processors. Otherwise, customers with older computers would
refuse to upgrade to new versions of MS-DOS.
12. Challenge: In real-address mode, demonstrate two segment-offset
addresses that point to the same linear address?
The following segment-offset addresses point to the same linear address:
0640:0100 and
0630:0200.
2.4.5 Section Review

1. Describe SRAM and its most common use?


SRAM is an acronym for Static RAM, used in CPU cache memory
2. Describe VRAM?
VRAM (video ram) holds displayable video data. When CRT monitors are
used, VRAM is dual ported, allowing one port to continuously refresh the
display while another port writes data to the display
3. List at least two features found in the Intel P965 Express chipset?
1.Intel Fast Memory Access uses an updated Memory Controller Hub (MCH).
2. I/O Controller Hub (Intel ICH8/R/DH) that supports serial ATA devices (disk
drives).
3. Support for 10 USB ports, 6 PCI express slots, networking, and Intel Quiet
System technology.
4. High definition audio chip.
2.4.5 Section Review

4. Name four types of RAM mentioned in this chapter.


Dynamic RAM, Static RAM, Video RAM, and CMOS RAM

5. Which type of RAM is used for Level 2 cache memory?


Static Ram

6. What advantages does a USB device offer over a standard serial or


parallel device? (important).
The computer can query a device connected via USB to find out its name and device
type and the type of driver it supports. The computer can also suspend power to
individual devices. None of these capabilities is possible with serial and parallel
port
2.4.5 Section Review

7. What is the purpose of the 8259A PIC controller?


The 8259 is the interrupt controller chip, sometimes called PIC, that
schedules hardware interrupts and interrupts the CPU.

8. What are the main differences between Wi-Fi and Bluetooth?


Bluetooth is a wireless communication protocol for exchanging small
amounts of data over short distances. It is commonly used with mobile
devices such as cell phones and PDAs.
Wi-Fi devices operate at a greater speed and capacity than Bluetooth.
Wi-Fi devices often communicate with each other when in the range of a
wireless network.
2.5.2 Section Review

1. Of the four levels of input/output in a computer system, which is the


most universal and portable?
The application program level
2. What characteristics distinguish BIOS-level input/output?
BIOS functions communicate directly with the system hardware. They are
independent of the operating system.
3. Why are device drivers necessary, given that the BIOS already has code
that communicates with the computers hardware?
New devices are invented all the time with capabilities that were often
not anticipated when the BIOS was written
4. In the example regarding displaying a string of characters, which level
exists between the operating system and the video controller card?
The BIOS level
2.5.2 Section Review

5. At which level(s) can an assembly language program manipulate


input/output?
The operating system, BIOS, and hardware levels.
6. Why do game programs often send their sound output directly to the
sound cards hardware ports?
Game programs often try to take advantage of the latest features in
specialized sound cards. It should be noted that MS-DOS game
applications were more prone to do this than games running under MS-
Windows. In fact, Windows-NT, 2000, and XP all prevent applications
from directly accessing system hardware.
7. Challenge: Is it likely that the BIOS for a computer running MS-Windows
would be different from that used by a computer running Linux?
No. The same BIOS would work for both operating systems. Many
computer owners install two or three operating systems on
2.7 Chapter Exercises

1. What are some of the innovative characteristics of


the P6 processor architecture?
2.7 Chapter Exercises

3. Briefly explain the meaning of out of order execution. Why is it useful?


Answer: See Assignment

4. In processors that use Intels Hyper threading Technology, what


components are coupled with each logical processor?
cache, registers, and execution units

5. What is the size of the physical address space in a processor that


implements the Intel64 architecture?
Their physical address space can be greater than 64 Gbytes.
6. What are the Intel Virtual Machine Extensions? Why are virtual machines useful
today?
Answer: See Assignment
Extra Questions
1. Define pipelined execution?
Executing processor stages in parallel, making possible the overlapped execution
of machine instructions.
2. What are the IA-32 processor 's three basic modes of operations?
Real-address mode, Protected mode, and System Management mode
3. Name all eight 32-bit general-purpose registers?
EAX: extended accumulator register.
ECX: Extended Counter Register.
ESP: extended stack pointer.
ESI: extended source index.
EDI: extended destination index.
EBP: extended frame pointer.
EBX,EDX.
Extra Questions
4. Name all six segment registers?
CS: Code Segment
SS: Stack Segment
DS: Data Segment
ES,FS,GS
5. What special purpose does the ECX register serve'?
Extended Counter Register used for loop counting .
6. Besides the stack pointer (ESP). which other register points to variables on the stack'?
EBP
7. Name at least four CPU status flags?
Carry Flag: unsigned arithmetic out of range
Overflow Flag: signed arithmetic out of range
Sign Flag: result is negative
Zero Flag: result is zero
Auxiliary Carry Flag: carry from bit 3 to bit 4
Parity Flag: sum of 1 bits is an even number

You might also like