409 Part 2
409 Part 2
409 Part 2
6.0 INTRODUCTION
Memory is a storage device used to hold programs, data, results, etc. Three types of memory are
prevalent in modern computers - Semiconductor, Magnetic, and Optical memory. Of these,
Semiconductor memory is faster, more compact, consumes less power but is more expensive. In
contrast, Magnetic and Optical memories are slower but cheaper.
Secondary memory is used for bulk storage of programs, data, system software, assemblers,
compilers, and large-data files. It should not be volatile, meaning it should be able to store
information permanently. Magnetic memory, such as hard disks, are commonly used as
secondary memories due to these properties.
**Check textbook for diagram here
The chapter discusses two types of cache schemes, write-through and write-back. In a
write-through cache, the main memory is updated each time the CPU writes into the cache. This
approach ensures data consistency between the cache and main memory, which is particularly
beneficial in systems that use direct memory access (DMA) for data transfer. However, this can
also slow down the CPU if it has to wait for the write operation in the main memory to complete.
To address this issue, a write buffer is introduced for temporary storage of write requests. This
allows the CPU to proceed to the next instruction without waiting for the main memory to be
updated. The contents of this buffer are then sent to the main memory when it is not occupied
with read requests, effectively optimizing the overall memory operations and enhancing system
performance.
In a write-back cache, only the cache memory is updated during a write operation with updated
locations in the cache marked by flags for later copying into the main memory. This method
minimizes bus utilization and avoids unnecessary system bottlenecks, thereby enhancing
performance. Additionally, a write buffer is utilized in the write-back cache scenario, which
temporarily holds flagged blocks of data earmarked for removal from the cache. This buffer
mechanism allows the CPU to quickly fetch new blocks of data from the main memory without
having to wait for space to be made in the cache, effectively streamlining the data access process
and maintaining optimal system performance.
Cache memory is available at multiple levels, known as first-level cache (L1), second-level
cache (L2), and third-level cache (L3). These caches can be located either within (internal cache)
or outside (external cache) the microprocessor.
The section also details specific cache controllers like Intel's 82496, 82497, and 82498 developed
for controlling second-level cache memory in Pentium-based computers. Intel's 82496 and 82497
cache controllers support a memory bus width of 32, 64, and 128-bit and line sizes of 16, 32, and
64 bytes. They manage 256KB and 512KB cache memories. The 82498 controller, meanwhile,
supports 64 and 128-bit wide memory bus, line sizes of 32 and 64 bytes, and manages larger
cache memory from 1MB to 2MB. These controllers control the 82491, 82492, and 82493
SRAM cache memories, respectively. In the latest Pentium processors, the second-level cache
and its controller are integrated into the processor.
The process of moving program parts between main memory and secondary memory is called
swapping, enabling programs requiring larger memory capacity than the main memory to
execute. Virtual memory space is typically much larger than physical memory space. For
instance, the Intel 80386 can directly address GBs of physical memory, but its virtual memory
addressing capacity is 64 TB.
Programs use logical addresses, which are translated into physical addresses by the Memory
Management Unit (MMU). The MMU resides between the processor and the main memory and
determines whether a logical address generated by the CPU is present in the physical memory. If
the address isn't in the main memory, the MMU interrupts the CPU to load the required
information from the secondary memory. Logical addresses are also referred to as virtual
addresses in a system equipped with virtual memory.
Flash Memory/SSD
These are non-volatile, electrically erasable, and programmable permanent type memories with
high reliability, low power consumption, high packing density, and lower cost. They're available
as flash cards and flash drives. An example is the Samsung 970 EVO Plus, a high-performance
SSD.
Non-Volatile RAM
This is a type of RAM that retains information even when the system's power is turned off. This
is useful in applications where it is critical that data not be lost, such as in embedded systems and
critical data storage. An example is the STMicroelectronics M48Z02, a 2K x 8 zero-power
SRAM.
Bit-oriented memory chips, like those rated 256M x 1 bit store one bit per memory cell, allowing
each bit to be addressed and read or written individually. Nibble-oriented memory chips, like
those rated 256 K x 4 bits, store a nibble (four bits) per cell with each nibble individually
addressable and operable.
Byte-oriented memory chips store a byte (eight bits) per cell, and each byte can be individually
addressed. An example would be a chip rated as 4M x 8 bits, or 4M x 9 bits if a parity bit is
included for error detection.
Intel 8206 is an error detection and correction unit that provides error detection and correction
for static and dynamic RAMs. It can detect and correct all single-bit errors, and detect all
double-bit and higher multiple bit errors. It uses a modified Hamming code for error detection
and correction.
Two data recording techniques are used: longitudinal recording and vertical recording, with the
latter allowing more data storage. A read head, which is a magnetoresistive (MR) sensor, is used
to read data. Changes in the MR sensor's electrical resistance, caused by the direction of
magnetization of the moving medium under it, are detected as voltage signals.
Some older and low-capacity disks use a single head for both reading and writing operations.
The direction of magnetization of a very small area of the magnetic film determines the polarity
of electric pulses produced during the read operation. Modern computers typically use magnetic
disks, including hard disks and floppy disks, and magnetic tapes as types of magnetic memory.
6.6.1 Magnetic Disks
Magnetic disks, including hard disks and floppy disks, store data on their surfaces, which are
divided into concentric circular tracks and sectors. Each track has the same number of sectors,
resulting in higher bit density in inner tracks. To utilize unused storage space on outer tracks, the
disk surface is divided into zones with varying numbers of sectors per track.
The disks, which are semi-random devices, are mounted on a rotary drive to rotate. The
read/write head remains stationary on the addressed track, while the disk rotates to bring the
addressed sector under the read/write head. The sum of the time required to move the read/write
head to the addressed track (seek time) and the time required to bring the starting position of the
addressed sector under the read/write head (latency time) is known as access time.
A disk controller is required for magnetic disk drives. Its functions include interfacing a disk
drive system to the CPU, disk drive selection, track and sector selection, issuing read/write
commands to the disk drive system, data separation, serial-to-parallel and parallel-to-serial
conversion, and error detection. Data to be stored on a magnetic disk must be converted from
byte form to serial format, and vice versa for data read from a magnetic disk.
Hard disks' capacity ranges from 40 GB to 750 GB, with access times between 5 and 10
milliseconds. To address mismatched data transfer rates between the main memory and hard disk
memory, a semiconductor memory known as a disk cache is used. In Redundant Arrays of
Independent Disks (RAID) systems, multiple disks operate in parallel, storing the same
information to bolster storage reliability. Additionally, removable and external hard disks are
available for backup memory. An important note on hard disk operation is that an air cushion
generated by high-speed rotations keeps the read/write head off the disk surface. This prevents
damage but also necessitates a dust-free environment to avoid head crashes, which lead to data
loss.
Integrated Drive (or Device) Electronic (IDE) and Small Computer System Interface (SCSI) are
host adapters, not controllers. Enhanced IDE (EIDE) can interface hard disk drive, floppy disk
drive, optical disk drive, and tape drive. IDE or EIDE drives offer great ease of use, and one can
just plug them in to work. ATA is AT Attachment, and ATAPI is AT Attachment Packet Interface,
which are specifications for EIDE.
SCSI has a separate I/O bus called the SCSI bus. It can connect up to 15 devices, each with a
unique identification number. The latest version of SCSI, called SCSI-3, offers a data transfer
rate of 80 MB/s. SATA (Serial ATA) is a serial interface used for connecting motherboards to
various mass storage devices. With different versions, it offers a wide range of data transfer rates
and has a CRC mechanism for error detection. SATA Express and eSATA expand the SATA
capabilities with high-speed data transfer and external connectivity, respectively. On the other
hand, SAS (Serial Attached SCSI) improves upon traditional SCSI, using a serial mode of data
transmission and supporting a large number of hard disk drivers.
To improve tape utilization, multiple records can be grouped together in a block and recorded as
a single unit on the tape, with specific programs available to separate records within a block for
processing
6.12.2 Protection
Protection is crucial in a multiuser system to prevent interference between users or with the
operating system. The MMU provides this protection by checking the privilege-level of a
program requesting memory access. This mechanism is used to protect the operating system
from the users.
6.12.3 MC68851
MC68851 is a memory management unit developed by Motorola that uses the paging technique
for memory division. It is widely used with the 68000 family of microprocessors.
INTRODUCTION
This chapter highlights the essence of programming and system software. It delves into the
distinction between system software and user's programs, emphasizing the role of the operating
system. The chapter also touches upon utility programs, application software, and the benefits of
pre-written software for specific tasks.
8.2.1 Assembler
Assemblers translate programs written in assembly language into machine code. There are self
assemblers which operate on the same computer they produce codes for and cross assemblers
which can produce machine codes for a different computer. Assemblers can be categorized based
on the number of passes they make through the assembly program: One-Pass and Two-Pass.
8.3.4 Compiler
● Translates high-level language into machine language.
● Intelligent: checks for errors, limits, and ranges.
● Execution time is longer than that of an interpreter.
● Occupies a significant amount of memory, resulting in low efficiency.
● Types:
● Self or Resident Compiler: Runs on the same computer it produces code for.
● Cross-Compiler: Produces code for a different computer than the one it's running
on.
8.3.5 Interpreter
● Translates and executes high-level language programs one statement at a time.
● Doesn't save the translated object code for future use.
● Faster to start executing code but overall slower than a compiler.
● Advantage: occupies less memory, making it suitable for systems with limited space.
● Example: Instructions within loops must be re-interpreted every time the loop is
executed.
8.4 STACK
● A reserved area in memory used to save register content during program execution.
● Operates on a last-in-first-out (LIFO) principle.
● Two main operations:
● PUSH: Save register contents to the stack.
● POP: Retrieve contents from the stack back to the registers.
● Stack operations are faster than general memory access.
8.5 SUBROUTINES
● Specific sequences of instructions to perform a repeated subtask within a main program.
● Can be called from the main program using the CALL instruction.
● Program Counter (PC) content is saved on the stack when a subroutine starts.
● The RET (return) instruction marks the end of a subroutine, restoring the PC and
resuming the main program execution from where it left off.
8.6 DEBUGGING OF PROGRAMS
Introduction to Debugging
The term 'bugs' refers to program errors. It is the process of finding and fixing these errors.
Debugging ensures programs run correctly, as they often have errors on initial runs.
Types of Errors
Syntax errors, caused by incorrect language use, are detected by compilers and interpreters.
Debugging Techniques
● Single Step Control: Execute the program step by step, examining the results of
each step.
● Break Point Technique: Allows execution only up to a certain point, helping to
isolate the section containing errors. Software interrupts like RST (for Intel 8085)
and INT (for Intel 8086) facilitate this.
Tools for Debugging
● Simulators: Programs that mimic the execution of another program, useful for
logic checks.
● Logic Analyzers: Digital tools that detect and display the state of digital signals
during clock cycles, aiding in resolving timing issues.
● Trace Routines: Provide insights into the processor's status at set intervals.
● Memory Dumps: Listings of memory contents, used as a last-resort debugging
method.
8.7 MACRO
A macro assigns a name to a sequence of instructions, which can be reused throughout a
program. Macros simplify code, making it more readable. They are suitable for short sequences,
while subroutines are for longer ones.
Macro Examples: (i) Example 1 (COMP2): Takes the 2's complement of contents in a given
memory location (ii)Example 2 (SHIFT2): Shifts the content of the accumulator left by 2 bits
using two ADD A instructions.
Other functionalities beyond macro processing include spelling checkers, calendars, notepads,
and calculators. These tools can be quickly invoked with a few keystrokes.
Note: Debugging is an essential process in software development, ensuring that programs run
without errors. The use of tools, techniques, and macros simplifies and streamlines this process,
making programming more efficient and error-free.
Booting
This is the process of loading the OS into memory. It is initiated by a small program, the
bootstrap loader, from a ROM. After the OS is fully loaded, the computer can process user
commands.
8.17.2 LINUX
It is a multiuser and multitasking OS, a version of UNIX. It is developed collaboratively
worldwide to create a free UNIX clone. It was started by Linus Torvalds and incorporates
features from MINIX OS. It is compatible with various devices and platforms and also
Incorporates TCP/IP networking protocol.
The Solaris 8 phase brought with it an updated UNIX system, set to power future SUN server
computers, especially those with the UltraSparc III processor. This version ensured compatibility
with older applications, specifically from Solaris-2.6 and Solaris-7.
Coming to its features, Mac OS 8.5 was designed for PowerPC processors. It flaunted full
memory protection and advanced process management. This OS version has a microkernel
enabling UNIX-like process management. Furthermore, its internet search capabilities were
enhanced, allowing users to search by content and use multiple search engines at once. One of
the unique areas where Macintosh OS outshined others was the Color Sync feature, providing an
unparalleled visual representation.
The subsequent version, Mac OS-X, broadened the horizon with an object-oriented programming
environment. Its microkernel was crafted to provide LINUX-like facilities, expanding its
capabilities.
One of the core functions of NetWare is to ensure fair time-slices to processes. It efficiently
supports sharing various resources like printers, plotters, and storage devices, making
collaboration effortless.
The Novell-5.0 version went a step further. While it maintained its traditional LAN sharing
features, it added enhancements tailored for the Internet environment. This version was pivotal in
introducing centralized network management services. Moreover, its IPX-to IP support bridged
the gap between IPX-based LANs and IP-based networks.
Editor
An editor is a tool that enables programmers to create, modify, and store source programs or text.
Examples include WordStar and Edlin. It works under the control of the operating system and comes with
unique commands to manage text or program content.
File Manager
The file manager is instrumental in creating, copying, updating, or deleting files on disks. It maintains a
directory of files stored on the disk, containing details like file name, size, date and time, and unused
memory capacity.
Loader
A loader is responsible for loading the machine codes of a program into system memory. Depending on
the format (absolute or relocatable), the loader might simply load the program, or the locator might assign
specific addresses before loading.
Locator
A locator functions to assign specific memory addresses for the machine code of a program, preparing it
to be loaded into the system memory.
Linker
A linker connects smaller programs (modules) to form a single program. It also links subroutines with the
main program and operates on machine codes. The process makes it easier to develop, test, and debug
programs.
8.19 APPLICATION PACKAGES
Application packages are software written to perform specific jobs, and they can be applied to various
tasks like business, engineering, education, etc. Examples include word processing, spreadsheets, CAD,
dBASE, MATLAB, SIMULINK, and integrated packages like MS-Office.
Creation of Spreadsheet
Upon initiating, the software displays rows and columns. Each intersection point is termed a cell.
Cells have unique addresses. For instance, A1 represents the intersection of the first column and
row. Cells can contain text, numbers, labels, values, or formulas. Formulas establish relationships
between cells. A group of adjacent cells is called a range, e.gB3:B10 or B3:H3. The screen
comprises the control panel (with edit and mode areas) and the spreadsheet itself.
Spreadsheet Commands
1. Copy Command: Duplicates content from one cell or range to another, essential for
repetitive formula structures.
2. Insert/Delete Command: Add or remove columns/rows. The software auto-adjusts cell
addresses and related formulas.
3. Window Command: Splits the screen either horizontally or vertically to view different
sections simultaneously.
4. Format, Save, Print Commands: Adjust appearance, store data, and print the spreadsheet.
5. Built-in Functions: Simplify tasks, like SUM or AVG, to minimize manual formula
creation.
MS-Excel Specifics
MS-Excel is part of MS-Office, it's a versatile data analysis tool. It can generate charts and offers
voice command features. Additional Excel features include AutoCalculate, AutoSum, and
spreadsheet templates. Templates are pre-designed spreadsheets with set labels and formulas for
common data analysis types. Users only need to input data values. Several template products are
available in the market.
Notable integrated packages are MS-Office and LOTUS 1-2-3. Other powerful options include
Framework by Ashton-Tate and Symphony by Lotus Development Corporation. Symphony, for
instance, boasts advanced windowing capabilities and a powerful command language.
Users with standalone packages can buy system integrators or integrating software shells to
coordinate them, ensuring consistency across commands. There are scenarios where a user
primarily uses one application but requires simpler functions from others. Memory-resident
packages can supplement these primary applications. Examples include a notepad for a
spreadsheet user or a simple calculator for someone using a word processor.
Key services provided by ROM-BIOS include screen printing, video services, disk services, port
services, keyboard services, and bootstrapping. On top of ROM-BIOS programs, other system
programs provide more advanced support services. These include operating systems like
WINDOWS-XP. A main distinction between ROM-BIOS and operating systems like
WINDOWS-XP is the level of user services. While ROM-BIOS operates on a lower level,
WINDOWS-XP offers higher-level functions, such as file input and output.