Processor Memory
Processor Memory
1672 Gottfried Leibniz - Same a Pascal's but can also multiply and divide.
- An electronic device that processes input (data) via following a series of instructions (program) to give an output (information).
- Each instruction tells the computer to perform one task.
LIMITATIONS :
- It can only do what it is told (instructed / programmed) to do, in a language (code) it can use.
Language: Way in which an instruction is written and the laws governing it's use.
- The computer is an electronic device => electricity used, therefore represented by electricity.
- Electricity can either flow or not flow ,electric switches. => switch on/off 2 states .
- Each state is represented by a digit. 2 states => 2 digits :- binary :- 0 for off, 1 for on.
- Each binary digit 0 /1 is called a bit which is the fundamental representation of data.
- Combining these bits in a specific way and giving meaning (a code) to the combinations, we can represent input.
e.g. 00 = N, 01 = S , 10 = E, 11 = W.
Computer processes data only by these switches (millions), hence work with only binary values.
Can have 2 bit , 4 bit, 8 bit ,16 bit , 32 bit, 64 bit.. units of data being a measure of the amount of data that can be used at a time by a
computer.
Units of storage
Unit Value
Kilobyte (Kb) ~1000 Bytes = 210 bytes
Megabyte (Mb) ~1000 Kb = 220 bytes
Gigabyte (Gb) ~1000 Mb = 230 bytes
Terabyte (Tb) ~ 1000 Gb = 240 bytes
An arbitrary Computer System
This is based on devices that are members of the three major components of a computer system
- Input , Processing, Output. Clock
Processor
Thus a system consists of :- Input Devices, Processing unit,
Output Devices, Memory and
Control
Secondary Storage Devices.
Unit
Instruction :- A command to the computer when followed performs 1 task. It has a specific structure (format).
Language: Coded scheme by which programs are written, having their own set of instructions/ keywords, together with the laws
governing the use of these instructions.
Buffer :- A temporary storage area in memory used to equalize or balance different operating speeds. It can be used between a
slow input device such as a terminal keyboard and the main computer which operates at a very high speed.
- Data being transferred between the communicating devices is placed in a buffer until either device requests it at once.
- This is more efficient than having the devices continuously requesting or waiting on the other for data which would complicate
their interaction within the computer system.
MIPS:- Millions of instructions / second. Asuming a fixed instruction size,it better compares two unrelated processors’ speedss.
Secondary Storage :- Holds modifiable data/instructions for extended periods with a storage space much larger than RAM.
Clocks
Clocks, are used to keep time. There is a real-time clock inside a PC that is responsible for keeping track of the date and time, but there
are
many other clocks inside, which divide time into MUCH smaller increments. These clocks are used to synchronize the work being
performed by the PC's many different components. Each is responsible for sending out extremely rapid pulses of electricity, which are
then
sent through "logic gates", which process each pulse, sometimes stopping them, other times letting them go through. These pulses, or
"clock
cycles" are the backbone of binary logic processing. "Clock speeds" are measured in megahertz, (MHz) which means "millions of cycles
per
second".
The microprocessor (CPU) has an internal clock that determines how fast an operation will take in the internal processing circuitry. The
clock speed is a base indicator of how quickly the processor can execute an instruction. Some processors are "speed doubled". This means
that processor like a 486 DX2/50 is actually a 25 MHz chip with a double speed processor. The chip communicates with the other devices
on the bus at 25 MHz, but performs all of its internal functions at 50Mhz. This is one way to get more speed out of your PC, but the chip
will not perform as well as a chip that is designed to use the bus at 50 MHz (as well as internally function at that speed). The CPU is also
sometimes rated in "MIPs", which means how many Millions of Instructions Per Second it can process.
The speed of the PC is determined by other things as well as the clock speed. The type and amount of RAM on the SIMMs, the "width" of
the bus, and the amount of cache RAM are very important as well. If you compare two PCs, one with slower clock speed, and the other
with
a less powerful microprocessor, the overall speed of the PC with the more powerful microprocessor will usually be faster.
The rest of the PC is almost always running at a slower speed than the CPU, and for this reason there are many different clocks within the
PC. Plug-in devices like video cards often have their own clocks, allowing them to run their internal processing duties at their own speeds.
Clock:- A circuit that emits regular pulses via a crystal oscillator, to control the operation and timing of the computer. (A regular
pulse refers to a constant pulse width and separation between consecutive pulses)
- This is required in digital circuits because the order in which events happen is critical. At times one event must precede
another or more than one simultaneously. Thus used to provide synchronization and the required timing relations.
Clock Rate:- Rate at which the clock circuit generates pulses. Measured by MHz (Millions of cycles (pulses) per second). ~1-100MHz
- Best way to compare the processing speeds between processors within the same family.
Clock cycle time:- The time between 2 consecutive pulses or time to generate a pulse ~1000-10nsec.
In a computer many events may happen during a clock cycle. If they are to be done in order, the clock cycle must be divided into
smaller
HIGH cycles,
1 done by (phase) shifting the clock pulses. (Delay circuits are used on the main clock)
TheseVoltage
events are micro-operations that define an instruction which need to be synchronized for orderly execution..
LOW 0
THE PROCESSOR
Control Unit (CU) :- Controls / coordinates processor's operation and signals various parts for orderly working.
Responsible for the orderly fetching of instructions from main memory & determines their types for execution.
Arithmetic Logic Unit (ALU) :- Performs the corresponding logical / arithmetic operations on the data via the CU's prompting.
Registers - High speed memory devices used for temporary storage of small amounts of data or intermittent results during processing, each
one of a set having a special purpose. It’s size depends on the size of a typical instruction:- word.
e.g. PC : Program counter = the memory address of the next instruction to be fetched.
IR : Instruction Register = holds the instruction being currently processed.
MAR : Memory address register = the memory address/location of an instruction/data to be fetched
MDR : Memory data register = holds the contents of a memory access.
ACC : Accumulator.
Bus :- The electrical paths connecting various components together to allow control signals, addresses and data to be transferred
between them. The amount of signals transferable depends on the bus width (size).
THE FETCH-EXECUTE (MACHINE) CYCLE FOR VON NEUMANN MACHINES
A cycle of operations performed by the processor in which an instruction is obtained, decoded and run. This includes the fetch cycle
(instruction cycle) performed by the CU and the Execute cycle performed by the ALU. This process is repeated normally until all
instructions in a program have been carried out.
1. The unit by which data will be processed in this machine will be a wordsize of 2 bytes. (1 word = 2 bytes)
2. An instruction must follow the wordsize (1 instruction = 1 word).
It has 2 parts:- opcode (operation) and an operand (value/value's address) i.e. 1st byte = opcode, 2nd byte = operand.
3. Addresses are the memory locations of an instruction. (Address value = instruction’s /data’s starting byte).
Consider two instructions:-
ADD [X] : add to accumulator contents the value stored in word address X, storing the results in the accumulator
2 IR
3 20 Arithmetic
58 Logic Unit
4
MDR ACC
LDV [Y] : load into accumulator the contents of memory at word address Y
CU:
1. Examines the PC register for the RAM address of the next instruction.
2. PC --> MAR ; read signal.
3. M[MAR] --> MDR i.e. reads memory at location MAR into MDR
4. PC = PC + 1 (incremented by 1 instruction/word).
5. MDR --> IR;
6. Decodes IR contents to determine instruction type ,causing respective control signals to be sent to do either :-
i) completing the AL instruction (fetching the Or (ii) performing the NON-AL instruction and skipping ALU use.
operand(s)) IR (address) in IR --> MAR if indirect addr.
operand (address) in IR --> MAR M[MAR] --> MDR --> ACC
M[MAR] --> MDR --> ACC Signals respective circuit in ALU
Signals respective circuit in ALU
ALU:
7. Processes instruction via respective Arithmetic/logic circuits with predefined registers (e.g. ACC)
8. Stores result into register (ACC)
NOTE
- Fetching (Retrieving) is considered only when a new instruction is to be processed.
- An instruction is interpreted as a hardware microprogram which contains many smaller hardware operations (microinstructions).
- The time taken for a single fetch-execute (machine) cycle is not necessarily a clock cycle.
- A hardware operation (microinstruction) is performed in a clock pulse/cycle. If more needs to be done, shifted clock pulses are used.
ADDRESSING MODES
The above program showed an example of indirect addressing. The two simplest methods of referring to data stored in memory are:-
1. Direct Addressing :- operand = actual value.
2. Indirect Addressing :- operand = memory location of the value. MAR is utilized fully here. I.e. IR(address) MAR
PIPELINING
Method of speeding up the Fetch-Execute cycle by fetching not just the next instruction but the next few that follow it in main
memory. Hence increasing the effective speed (throughput) at which instructions are executed by a processor.
It is the normal way to run a program by executing each instruction one after the other in sequence where each instruction is
processed one at a time by the processor. This is typical serial processing.
However with pipelining you have more than one instruction being processed at the same time, each at a different stage of the
fetch-execute cycle such that maximum use of the processor is made with very little wastage of processing time.
i.e. Let Ix be the Instruction x.
FETCH I1 I2 I3
DECODE I1 I2
EXECUTE I1
increasing time t1 t2 t3
This means while I1 is being executed, I2 is being decoded and I3 is being fetched all at the same time instance t3.
Hence 3 instructions can be processed in one machine cycle for this example machine.
The instructions are placed into a queue of registers feeding into the IR.
There is a variety of processing techniques:- Based on the amount of instructions to be processed at the same time.
Serial Processing: - operations / instructions completed one after the other in order
Concurrent processing:- instructions overlap during intervals such that more than one instruction are processed simultaneously
at different stages , with some serial order.
The above two has a common trait in that the instructions are still done serially. This happens if the processor has one data
path, and has to be utilized among the instructions being processed .
Parallel processing :- Instructions are processed at the same time with no emphasis on order. This is mainly so if many data
paths exist in the processor so each instruction stream is processed independently.
Fetch I1 I2 I1 I2 I3 I1 I3 I2 I4
Decode I1 I2 I1 I2 I3 I1 I2
Execute I1 I2 I1 I2 I1 I2
time 1 2 3 4 5 6 1 2 3 4 1 2 3 1 2 3
This data path is the path which the instruction takes through the processor to be run.
If there are many data paths this means that different instructions can be processed at the same time.
THE ROLE OF THE O.S. IN BRIDGING THE HARDWARE APPLICATION GAP.
OPERATING SYSTEM
What? - System software that manages the use of a computer system's hardware resources for efficient operation, controlling
(limiting) direct hardware utilization by the application software or the user.
Why? - Performs 2 functions:- Acts as an extended machine & a resource manager.
User
Application Program
Operating System
Hardware
If there is no O.S., working with a computer will become tedious as well as dangerous, since:
- the user will have to know how the hardware works rather than spending more time on running the application.
- errors will be very hard to locate for debugging purposes.
- Unlimited access to critical hardware areas: simple errors may cause a critical system failure (or physical injury)
Thus the O.S. needs to limit the direct manipulation of hardware and make it easy to interface with.
It does this by setting up :
- user mode : environment for running user applications
- supervisor mode : environment holding critical system procedures away from direct user access
- The code comprising the main features of the O.S. loaded into memory is called the kernel. It holds the most referenced
functions / procedures for system operation :- internal commands.
- Extra code not frequently needed is stored on auxiliary storage :- external commands
Booting
This is the process that occurs when the computer is switched on.
Critical instructions are automatically fetched and executed from ROM to perform the tasks of self-testing as power is turned on (POST),
and routines (BIOS) to determine if devices/ peripherals are properly attached to the system for their eventual usage. If no problem is met,
the Operating system residing in secondary storage is read into memory and run, eventually managing and maintaining the system.
Microprograms :-
Made up of many microinstructions. These are more elementary and sparser in function than conventional machine language
instructions.
If on a machine the machine language instruction set is implemented via microprogramming, each machine language instruction = set of
microinstructions = microprogram.
e.g. ADD , STO, SUB ,LDV .. = machine language set = instruction set = set of microprograms.
ARCHITECTURAL HIERARCHY
Conventional Machine lang. level 2 firmware-programming machine instruction set on chip / processor
Interpreter :- Examines / executes L2 instructions directly into L1 instructions ( Machine instruction to microprogram)
Architecture :- Set of data types., operations & features of each level. It deals with these aspects that are visible to the user of that level.
5-15/20-50 mm wide/long. Metal pins are connected to the chip internally which protrude from the package along it's edges to
provide a bridge for the microcircuit.
CPU TYPES:- RISC vs CISC
Basically CISC chips have a complex structure resulting from a complex instruction set to allow backward compatibility. As a result
these instructions need to be broken down (decoded) for execution, which delays execution time.
However RISC chip design is based on keeping the data path during processing extremely simple so that the instruction can be
executed by hardware in the shortest possible time via not having any decoder. This is only possible by having very simple
instructions which need not be decoded. Efficient choice of relevant microcode is selected for simplicity and effectiveness.
CISC RISC
- Complex Instruction Set Computing Reduced Instruction Set Computing
- Complex instructions taking many cycles Simple instructions taking a cycle
- Instruction can do many tasks (General) Instruction does specifically 1 task
- Less or not pipelined (serial processing dominant) Highly pipelined ( parallel processing prevalent, can have unordered execution)
- Instructions are done by microprogram interpreting Instructions are done directly by hardware (= microinstruction)
- Instructions have different formats Fixed format instructions
- Many instructions & modes Few instructions & modes
- Complexity in microprogram (hardware) Complexity in compiler (software)
- One register set (few registers) Many register sets
- More firmware = larger size = larger power use Less firmware = smaller size = low power use
- Less processing per machine cycle done (more More processing per machine cycle (little/no decoding)
decoding)
Note:- Instruction set depends on microcode / programs used to do individual micro-operations.
Extended comparisons
more complex instructions need more processing time = decoding simple instructions require less time as they are executed directly
by hardware = no /little decoding
microinstructions are run by hardware paced by the clock pulses few microinstructions.
longer machine cycle @ clock-speed x => shorter machine cycle @ clock-speed x
- Both process the same instruction but the processing method each does is different.
- At the same clock-speed RISC >= CISC.
- MIPS (processing throughput) is better used to compare different chip architectures capabilities of processing.
- As we see, clock speed is a poor indicator in comparing the capabilities of the two chips.
Mov A 2X MHz
Mov Mov
A A
x MHz
RISC (O.S.) system: One designed to minimize the # of different microprocessor hardware operations in order to optimize the execution
speed. The software itself is complex, to handle the decoding if required for any complex instruction.
If a complex operation should be encountered / utilized , these can be represented /decoded as many simpler RISC instructions
if decoder needed, it should be made very simple & hardware based or complex and software based.
processing speed at it's worst rarely = the speed of CISC.
Large instruction set allows redundancies & complexities in formats.(inefficient) Not all instructions will be encountered. (20% of
instructions used 80% of time)
Reduced set of instructions selected to make the most efficient set efficient, optimal execution.
Common processor families
Manufacturer Family Type Date Notes
Intel 80x86 CISC 1976-199?
i960 RISC
Motorola 680xx CISC 1978-1993 Utilized by Apple computers
88000 RISC
AMD Kx RISC
29000 CISC
Cyrix xX86 CISC
Hewlett-Packard HP-PA RISC
Acorn ARM RISC Archimedes = 1st RISC PC
Digital Alpha RISC
Sun ULTRASPARC RISC
IBM RT/PC (IBM 801) RISC First IBM RISC Machine
SP/2 RISC
RS/6000 RISC
MIPS Rx000 RISC R2000/3000/4000 | R2010 coprocessor
1989 80486 - (386 & 387 co-processor on one chip) - other speeds : 25,33,50 MHz for DX chip
- 32 bit register / data bus : 16, 25 MHz for SX chip.
- 4 Gb addressable : 50, 66 MHz for DX2 chip
- memory cache on chip : 75,100 MHz for DX4 chip
- SL chip variants (low power consumption)
1993 Pentium (P5) - 64 bit CPU
- Internal 64 bit register / external 32 bit data bus 60,66,75,90, 100,120, 133,150,180,200 MHz
- Not efficient in changing between 16 & 32 bit modes
1995 Pentium Pro - 64 bit CPU
(P6) - Pentium:- internal cache (16-32K) at processor speed
- internal 64 bit register / external 32 bit data bus - speeds : 180,200 MHz.
- Optimized for 32 bit instructions.
- Symmetric multiprocessing (SMP) (2 / 4 processors).
1996 Pentium - 64 bit CPU
MMX - internal 64 bit register / external 32 bit data bus Speeds : 166, 200,233 MHz.
(P6) - Pentium Pro internal cache removed & replaced with
a multimedia instruction set.
1997 Pentium II - Combined Pentium Pro with MMX instruction set - Speeds : 233, 266, 300, 333, 350, 400, 450 MHz
(P6) - Increased internal cache by 16K at slower speeds.
- Can effectively run 16/32 bit instructions
- SMP supported (2 - 6 processors)
- uses a SEC slot (Single Edge Cartridge)
Co-processor:- A separate processor specifically built to perform complex mathematical tasks (in CAD) :- FPU (Floating Point Unit).
DX:- An INTEL processor having an enabled internal co-processor / FPU.
SX:- An INTEL processor whose internal FPU is disabled permanently and usually has an external bus smaller than it’s internal bus.
MEMORY DEVICES
Memory ( Main/ Primary storage):-
Part of the processing unit of the computer used for storing data and instructions to be used by the processor.
It consists of a large number of storage spaces (cells) each capable of holding a byte, located by a unique address. (binary)
Data can be fetched from (or stored to) any cell very rapidly.
0 1 0 0 1 0 1 0
Memory is considered to be of two major types being RAM & ROM Data = Column value = 8 bits = byte
Can read from / write to an addressed row.
Data transferred onto these data lines (bus).
RAM ROM
Random Access Memory Read Only Memory
Can read data from and write data to it. Can only read contents.
Used for primary storage to temporarily hold Used to store important control instructions required always by the system
data / instructions for use by the processor. which must never be changed.
e.g. POST & BIOS system ROM instructions/data
Contents vary depending on the user’s task. Contents cannot change, permanently embedded during manufacturing time.
Volatile storage. Requires power supply, otherwise Not volatile. Contents remain unchanged in the absence / presence of power.
it’s contents are lost when power is turned off.
Periodic recharging is needed to retain contents, as the Requires little or no power to function.
cells tend to lose their charge after a short time.
i.e. memory is refreshed or ‘topped-off’ regularly.
SIMM
Types of RAM/ROM chips
Memory access time:- Time allowed for a memory device to produce a dependable output signal after it receives an input signal requesting
it’s contents at an address. These values range from 60 to 200 ns.
Problem:-
For the memory to be in a ready state for processor usage, i.e. a state for it’s data to be allowed access to, it requires time to prepare
itself
for such usage periodically,. Time is required for recharging it’s contents during which absolutely no access is allowed.
The processor being operationally much faster than memory (~5 ns), therefore should wait on memory to use it.
Solution:- Two methods can be used to cater for this speed difference.
Why ? - To speed up data access between the two devices to equalize their speeds such that the faster obtains data quicker.
How ? - Two devices operating at widely differing speeds causes the faster to unavoidably wait on the slower for it’s data.
This waiting wastes time.
A cache running faster than the slower device will provide the requested data quicker to the faster device, reducing waiting.
The faster device no longer needs to contend with the slower device for it’s data, increasing data transfer efficiency.
When? - Needed wherever a bottleneck arises i.e. wherever two devices exchanging data differ in speeds greatly.
Disk >9 ms
How can this data be chosen ?
- A caching controller can be used. It intelligently determines what data
the faster component requires next, gets it before from the slower Disk/cache controller Falling access times
RAM
device and has it ready in the cache when the faster requires it.
Disk cache
- It does this by following a set of built-in algorithms and track what data
is being used over time with it to determine the most likely data to be Video ROM
used for caching. BIOS ROM Shadow RAM 60 – 200 ns
- It’s success is determined by the algorithms used to maximize cache
‘hits’ and the cache’s size. RAM cache controller
- It can be implemented as firmware/ software. RAM cache 10 – 30 ns
Processor < 10 ns
There are basically two major types of caching implemented in a computer system, where a fast , efficient data flow must be maintained:-
Utilizes a region of RAM which stores the requested contents from disk. Utilizes SRAM chips external to the processor.
Can store large quantities of disk contents in the cache It has a very small size.
Vast speed improvement (ms ns ) (factor of 1,000,000) Marginal speed improvement (ns ns) (factor of 3)
The processor possesses an internal cache also called L1 (Level 1) cache or primary cache, which caches data & instructions separately.
An L2 cache is also implemented which is external to the processor and is slower. It is also called secondary cache.
Write Through Cache :- Preempts (interrupts) the processor to put data on secondary storage in case of power outage.
Deferred writes :- Wait for system to be free of activities before writing to secondary storage.
Disk
Disk cache Memory cache processor
RAM
DMA's importance for I/O devices.
DMA - Direct Memory Access.
- A method whereby I/O devices access main memory directly without the active intervention of the processor by the assistance
of respective firmware control logic.
Problem - I/O devices send /receive data streams that cannot be interrupted or data will be lost. The processor slows down this process
to access memory thus increasing the possibility of data loss.
Solution:-
Another processor is used to specifically assist the I/O devices access to main memory. (DMA Controller Chip)
This relieves (frees) the CPU from the burden of accessing memory for the I/O devices, allowing it to do other processing while
the DMA chip assumes the responsibility of memory access simultaneously.
- The DMAC is given priority over the CPU for memory access at all times otherwise the data stream may become affected.
- Data transfer requires lots of signals to acquire the memory bus for memory access as well as to other devices for notification.
This is a lengthy process taking up many memory cycles. The CPU can thus process it's instructions during such periods.
What if the CPU requests memory via bus access while the DMAC is using memory ?
- the CPU will be allowed to wait until the DMAC is finished with memory.
What if the CPU & DMAC requests bus access to memory at the same time ?
- the DMAC is given first choice. Thus bus cycles access to memory (time period to get the bus) that the CPU would have used are
given to the DMAC to access memory. The DMAC is said to have stolen cycles from the CPU to gain memory access.
- Access to memory will be returned to the CPU after usage.
Memory
Data
Initialize DMAC
DMAC DMA granted Peripheral
Processor Bus granted
DMA requested
Bus requested
Address bus: Transfers signals, representing storage locations or device i.d.’s, of data/instructions or devices respectively for their
location.
Control bus : Transfers signals, representing control values, to devices for their co-ordination / control with the system.
Bus width The # of lines a bus has, where each line transports a bit signal. This one of the factors which determines the speed of
processing. It is also called bandwidth
Comparative sizes :- Data bus ~ Address Bus > > Control Bus
- Computers usually have separate dedicated buses to avoid overloading the path between components and to allow components to
interact with others at their common speeds most efficiently. e.g. processor & memory : very fast (needs a dedicated bus to avoid
delays in communication)
Computer system with a dedicated bus Computer system with a shared bus
CPU
Memory
Auxiliary Input
CPU Memory Storage Devices
Controller Controller
Expansion Buses
An expansion bus is an extension of the PC's data and address buses. It is the electric pathway used by your PC to connect the computer's
motherboard and peripheral devices. This bus connects to such things as memory boards, video adapter boards, on-board modems, bus
mouse boards, disk controllers and serial I/O boards. It includes a number of slots for these "plug-in" devices.
There are several types of expansion buses:- 8/16 bit :- ISA (AT ).
32 bit :- EISA , MCA , LOCAL BUS (PCI & VL-BUS)
ISA:- - Industry Standard Architecture
- 8 bit IBM AT bus (8086s) .
- Increased to 16 bit bandwidth .(used in PC/AT) (286-486)
- most common bus type / cheap
- speed of 8 MHz for both 8 / 16 bit buses. Transmission rate = 8Mb/\sec
PCMCIA / PC-Cards
These slots are very small and compact in size, allowing the insertion of an adapter card the size and shape of a credit card, to which a
peripheral device will be attached to.
- It requires very little power due to the use of compact micro-circuitry.
- Rugged :- as the components are solid state, with very little/ no moving parts.
- Convenient :- very portable (small size).
- Various types:- PCMCIA type I , II, III
- Somewhat expensive / not commonly used on desktop systems/ more used for notebook computers.
- Ports are fast:- integrated electronics reduce the distance to send data - lines are very short)
- Versatile:- can have multiple devices accessing a slot /some cards have multiple functions.
Comparison of Expansion Bus Standards
These are external points of connection (plug or socket interfaces) allowing the connection of peripheral devices onto a PC system.
- A special piece of circuitry is used to provide a compatibility connection between the port and the computer
- the circuitry sits between the computer and the "port" :- adapter card.
PARALLEL SERIAL
A parallel interface sends the set of bits comprising a character A serial interface sends or receives the bits comprising each
code all at the same time. character code one at a time in sequence in a continuous
0 stream.
0 1 1 1 1 0 1 1
1 1
=> more wires: A bit signal is transmitted by 1
it’s individual wire. 1 => less wires:- One wire being shared among bit signals.
1
0
Industry standard:- Centronics port. 1
1 Industry standard:- RS232 port:- 9 & 25 pin connectors
Faster / Shorter per byte transmission 1
Slower / Longer per byte transmission.
The multiple wiring for multiple data paths creates crosstalk.
i.e. voltages in wires create feedback onto neighboring wires No such crosstalk as each bit is sent at differing times to the
during data transmission causing interference of the data signals. other, hence they do not affect one another.
Used for devices which utilize a large quantity of data & faster.
(printers, external secondary storage) Devices utilize small data quantities and are fairly slow.
(modems, mice) (2400 – 115,000 bps)
Universal Serial Bus
Three drawbacks head any list of the most aggravating aspects of serial ports: low speed, complex cabling, and the limited number of
ports. The Universal Serial Bus breaks through all three, combining a signaling rate of 12 Mbits/sec with a mistake proof wiring system
and almost unlimited number of connections. The standard also supports lower speed devices sharing the same wiring system along
with high speed devices. The low speed signaling rate is 1.5 Mbits/sec.
First introduced in 1996, the USB is more than a successor to the RS-232C serial port. It provides the basic mechanism for connecting
most, if not all, peripherals to your PC. Everything from your keyboard to cash register drawer can connect simply and quickly with a USB
plug.
Background
Designed for those who would rather compute than worry about hardware, the premise underlying USB is the substitution of software
intelligence for cabling confusion. USB handles all the issues involved in linking multiple devices with different capabilities and data rates
with a layer cake of software. Along the way, it introduces its own new technology and terminology.
USB divides serial hardware into two classes, hubs and functions. A USB hub provides jacks into which you can plug functions. A USB
function is a device that actually does something. USB's designers imagined that a function may be anything that you can connect to your
computer including keyboards, mice, modems, printers, plotters, scanners, or whatever.
Rather than a simple point to point port, the USB acts as an actual bus that allows you to connect multiple peripherals to one jack on your
PC with all of the linked devices sharing exactly the same signals. Information passes across the bus in the form of packets, and all
functions receive all packets. Your PC accesses individual functions by adding a specific address to the packets, and only the function with
the correct address acts on the packets addressed to it.
The physical manifestation of USB is a port, a jack that's part of a hub. Each physical USB port connects to a single device, and a hub
offers multiple jacks to let you plug in several devices. You can plug one hub into another to provide several additional jacks and ports to
connect more devices. The USB design envisions a hierarchical system with hubs connected to hubs connected to hubs. In that each hub
allows multiple connections, the reach of the USB system branches out like a tree—or a tree's roots. Figure 21.16 gives a conceptual view
of the USB wiring system.
Figure 21.16 USB hierarchical interconnection scheme.
Your PC acts as the base hub for a USB system and is termed the host. The circuitry in your PC that controls this integral hub and the rest
of the USB system is called the bus controller. Each USB system has one and only one bus controller.
The USB system doesn't care which device you plug into which hub or how many levels down the hub hierarchy you put a particular
device. All the system requires is that you properly plug everything together following its simple rule—each device must plug into a hub—
and the USB software sorts everything out. This software, making up the USB protocol, is the most complex part of the design. In
comparison, the actual hardware is simple—but the hardware won't work without the protocol.
The wiring hardware imposes no limit on the number of devices and functions that you can connect in a USB system. You can plug hubs
into hubs into hubs fanning out into as many ports as you like. You do face limits, however. The protocol limits the number of functions on
one bus to 127 because of addressing limits. Seven bits are allowed for encoding function addresses, and one of the potential 128 is
reserved.
In addition, the wiring limits the distance at which you can place functions from hubs. The maximum length of a USB cable is five meters.
Because hubs can regenerate signals, however, your USB system can stretch out for greater distances by making multiple hops through
hubs.
As part of the Plug-and-Play process, the USB controller goes on a device hunt when you start your PC. It interrogates each device to find
out what it is. It then builds a map that locates each device by hub and port number. These become part of the packet address. When the
USB driver sends data out the port, it routes it to the proper device by this hub and port address.
Wiring with USB is, by design, trouble free. Because all devices receive all signals, you face no issues of routing. Because each port has a
single jack that accepts one and only one connector—and a connector of a specific matching type—you don't have to worry about adapters,
crossover cables or the other minutiae required to make old style serial connections work.
On the other hand, USB requires specific software support. Any device with a USB connector has the necessary firmware to handle USB
built in. But your PC also requires software to make the USB system work. Your PC's operating system must know how to send the
appropriate signals to its USB ports. In addition, each function must have a matching software driver. The function driver creates the
commands or packages the data for its associated device. An overall USB driver acts as the delivery service, providing the channel—called,
in USB terminology, a pipe—for routing the data to the various functions. Consequently, each USB you add to your PC requires software
installation along with plugging in the hardware.
Connectors
The USB system involves four different styles of connectors, two chassis-mounted jacks and two plugs at the ends of cables. Each jack and
plug comes in two varieties, A and B.
Hubs have A jacks. These are the primary outward manifestation of the USB port. The matching A plug attaches to the cable that leads to
the USB device. In the purest form of USB, this cable is permanently affixed to the device, and you need worry about no other plugs or
jacks.
The USB standard allows for a second, different style of plug and jack meant only to be used for inputs to USB devices. If a USB device
(other than a hub) requires a connector so that, as a convenience, you can remove the cable, it uses a USB "B" jack. The mating plug is a
"B" plug.
The motivation behind this multiplicity of connectors is to prevent rather than cause confusion. All USB cables have an A plug at one end
and a B plug at the other. One end must attach to a hub and the other to a device. You cannot inadvertently plug things together incorrectly.
Because all A jacks are outputs and all B jacks are inputs, only one form of detachable USB cable exists—one with an A plug at one end
and a B plug at the other. No crossover cables or adapters are needed for any USB wiring scheme.
Cable
The physical USB wiring uses a special four-wire cable. Two conductors in the cable transfer the data as a differential digital signal. That
is, the voltage on the two conductors is of equal magnitude and opposite polarity so that when subtracted from one another (finding the
difference) the result cancels out any noise that ordinarily would add equally to the signal on each line. In addition, the USB cable includes
a power signal, nominally five volts DC, and a ground return. The power signal allows you to supply power for external serial devices
through the USB cable.
The two data wires are twisted together as a pair. The power cables may or may not be.
To achieve its high data rate, the USB specification requires that certain physical characteristics of the cable be carefully controlled. Even
so, the maximum length permitted any USB cable is five meters.
One limit on cable length is the inevitable voltage drop suffered by the power signal. All wires offer some resistance to electrical flow,
and the resistance is proportional to the wire gauge. Hence, lower wire gauges (thicker wires) have lower resistance. Longer cables require
lower wire gauges. At maximum length, the USB specification requires 20-gauge wire, which is one step (two gauge numbers) thinner than
ordinary lamp cord.
TRANSMISSION CODING
What? - The way in which human input is represented to a computer in a form that it can use.
- The computer uses electrical signals = on/off states represented by binary digits 1/0 denoting these two states respectively.
- We can combine these signals/bits into a pattern to represent something meaningful.
- To represent meaning we use a code. Thus the code will be meaningful electrical bit patterns.
- How many bits?:- ~200 char used. As multiple of 2, 256 is enough=8 bits e.g. 'A' may be represented as the bit pattern 10000001.
There exists several coding methods to represent data in a computer system. Each one is standardized to allow compatibility.
Standardization exists to allow different systems to be compatible via following a fixed set of rules to ensure data is
represented always in the same format, otherwise data exchange will be complicated and limited between differing systems.
- BAUDOT
- 1850's used in telegraph machines.
- 5 bit code = character
- Only uppercase characters & figures used.
- Implemented a key = LTRS which was used to notify sent letters, FIGS used to notify figures sent.
- 32 characters. :- 2 keys FIGS, LTRS doubled range :- 32 for FIGS, 32 for LTRS.
- no order in the coding scheme. => 'A' = 11000 'B'= 10011
- ASCII : American national Standard Code for Information Interchange : To represent integers
- 1st introduced in 1966
- 7 bit code = a character
- code had a numerical order in the bit patterns. This made it easy to represent electronically.
- 128 characters represented (0-127) :- A-Z,a-z,0-9,punctuation ,control chars( LF,CR,BS)
96 printable 31 control chars
A byte can store +/- & digit => range +9 to -9 (if '+' not understood)
digit & digit => range 99 to -9 (if '+' understood)
- Disadvantage = Wasted a bit combination in that zero can have values 1010 0000 (+0) 1011 0000 (-0) when
we need only one combination to represent this number.
TRANSMISSION ERRORS :- PARITY CHECK CODES
Why? - to detect errors in data/information transmitted between two communicating devices where bits may be erroneously changed
in the course of transmission due to an electrical or mechanical failure.
How? - parity check system used :- two schemes :- Even Parity & Odd Parity
& two variants :- Longitudinal Parity & Cyclic Redundancy Check
Parity systems require an extra bit (parity bit) being transmitted / associated with a byte, whose sum value with the byte’s bits are used to
detect errors in the transmitted byte.
Even Parity :- All bit values in a byte and a parity bit add up to an even number means no errors are present.
- If byte bits added = odd, uses parity bit = 1 for even result.
- If byte bits added = even uses parity bit = 0 for even result.
Odd Parity :- All bit values in a byte and parity bit add up to an odd number means no errors are present.
- If byte bits added = odd, uses parity bit = 0 for odd result.
- If byte bits added = even uses parity bit = 1 for odd result.
Disadvantage:- Even or odd parity systems requires that the byte & parity bit sum value is either even or odd respectively.
However if an even number of bits have errors, these errors will not be detected by this system.