Architecture II Flashcards
What are the 4 systems of memory?
- Primary (system) = registers, cache, main memory, virtual; directly accessible by CPU
- secondary (online) = spinning hard-drives; data must be transferred to main memory when needed
- Tertiary (near-line) = tape libraries, optical jukebox; can be bought online quickly
- offline = optical disk, flash drive, external HDD; disconnected and used for backup purposes or transportation
- as you go down the levels the cost and speed decreases but size increases
What is computer memory?
- temporary storage area that holds data and program instructions that CPU needs
- consists of many storage cells, each of which can store 1 bit
- each storage location holds one word (8-bit computers hold 8 bits in location, 16 bit ones store 16 bits)
- impractical to assign distinct addresses to individual bit locations therefore addresses refer to byte location
What is RAM?
- Primary memory
- set of memory chips made of millions of transistors and capacitors
- directly accessed by CPU
- read/write
- volatile
- holds data/application programs from input devices or storages
Difference between SRAM and DRAM
SRAM; -bits stored in transistors -fast, retains state -complex construction, expensive -used for registers, cache, buffers in I/O devices, RAM in embedded systems DRAM -bits stored as charge -slower, discharges after sometime -structural simplicity, cheaper -used for bulk of PC main memory, large memory units
SRAM and DRAM implementation
- SRAM = 3 bit words, 2 bit addresses, combines; decoder, registers and clock switch
- DRAM = uses capacitors, new electronic component, store charge, same addressing as other RAMS
Difference between SIMM and DIMM
SIMM -Single in line memory module -32 bit bus width DIMM -Dual in line memory module -64-bit bus width -predominant type of memory module in 2018
What is DDR?
- Type of DRAM
- transfers data on both rising and falling edges of clock signal
- various versions with each becoming faster, more efficient, increasing in capacity and lowering in power consumption
What is ECC RAM?
- error correcting ram
- used in applications where high confidence needed (in-memory databases, popular servers, government, financial etc)
- has extra chip on the DIMM which store extra copies or checksums of the data
- not commonly used as regular DRAM is good
What is Virtual memory
You know
What is ROM?
- persistent state (non-volatile)
- used to store firmware and BIOS
- can be written to (Morden ones)
- limited number of write/erase cycles
Types of ROM
- Mask ROM = contents programmed using photolithography by manufacturer
- Programmable ROM = empty of data when the chip is manufactured; programmed by user. Cannot be erased when programmed
- erasable ROM = like PROM but the chip can be removed from computer and program erased
- Electrically EPROM = like EPROM but electricity is used to erase and reprogram selected contents
- flash memory
What is the principle of locality?
- temporal locality = values tend to be accessed repeatedly at nearby times
- sequential locality = same sequences tend to be re-accessed in same orders
- spatial locality = values nearby in memory tend to be accessed together
- applies to both instructions and data
What are the levels of cache memory?
- L1 includes three different sections; instruction (Harvard) cache, data cache, translation lookaside buffer cache virtual memory page tables
- L2 is shared, also L3 is a thing
- cache nowadays is located on CPU
What is a cache line
- cache memory is made of cache lines
- block = copies of several contiguous words from memory
- tag = address or other ID describing which memory is copied in the block
- dirty bit = logging whether the block data is modified
What is hit/miss?
What is the victim?
- requested data is found/not found
- hit/miss rate = factor of time data is found/not found (max 1)
- hit time = time required to access requested data
- miss penalty = time required to process a miss
- cached data to be thrown out to make room for new data
What is hashing?
- hash function maps a big datum to a smaller one
- not usually possible to recover original from the hash data
3 types of hashing algorithms?
Direct = always read and or store address and block in the same place; easy fast and cheap, different values produce same hash Associative = store tag at any available line; can cache all the best addresses at once, cost/complexity of digital logic is high Hybrid = hash address to subset of lines in cache memory then use associative rules inside these subset
What is special about cache write?
- similar to reading from cache but victim cant just be thrown away, needs to be written to memory
- write through = copy to RAM and unset diary bit shortly after cache write (uses lots of bus bandwidth)
- write back = write the RAM only when victimised (slower at the time)
What is the layout of a disk drive?
- each surface is divided into a number of concentric tracks
- track has same width as head and a number of sectors
- adjacent sectors and tracks are separated by gaps
- data transferred to and from disk in sectors
- each sector has a unique address
- data is accessed in a random-access manner
What affects a disk drives performance?
- access time spit into; seek time (time it takes for arm to position over desired track) and rotational delay (time it takes for desired sector to position itself under head)
- transfer time = time it takes to read/write data
What is RAID
- redundant array of independent discs
- method to make hard discs more resilient to failure
- use multiple discs as redundant backup and or speed up
- various architectures including; RAID1 (simple backup of complete disc), RAID5 (file striping, allows access to many parts of files at the same time
What is I/O?
- any transfer of data to or from the CPU/memory combo is considered I/O
- if CPU is brain then I/O is nervous system
How do we ensure a node can send a message to another node
The node must
- announce who its for
- announce the type of message
- announce the data
- ensure the above signals don’t collide with signals being sent by other nodes
Advantages and disadvantages of the bus
- easy to add new devices
- low cost due to shared wires
- bottleneck; performance of the system limited by the bus
- performance limited by physical factors (wire length, number of connections)
Non-bus networks?
What is bandwidth?
- point to point
- mesh networks
- bandwidth = lane speed * number of lanes
- how much data can be transferred in a time
What determines the size of memory?
- size of addressable locations
- width of address bus
- 32 bit systems have 2^32 amount of memory or 4GB
What is MAR and MBR?
- MAR hols address of read/write to go on address line
- MBR holds data to go on/retrieved from data line
- control uni connects them temporarily to the bus and adds the control one signal
What is the system bus and the expansion bus?
- system bus connects the CPU to main memory on the system board
- expansion bus allows the CPU o communicate with peripheral devices
What is an I/O module?
- any external device attaches to a computer by a link to an I/O module
- appears to the CPU and assembly programmer as an area of read/writable memory just like main RAM
- functions include; device communication, control and timing, data buffering and error detection
What might writing to I/O module addresses involve?
- transmit commands to the module/device
- send data to the module/device
What might reading from I/O module address involve?
- read data from the module/device
- read status information from the module/device
How do I/O modules handle control and timing?
- must be able to co-ordinate the flow of data between the internal resources and external devices
- devices may be slow so module manages them independent of the CPU
- this allows the CPU to go and do other things at the same time
- another form of parallelism
How is data sent to IO module?
- data coming from main memory is sent to a module in a rapid burst
- data is then buffered in the module and sent to peripheral device at its data rate due to the transfer rate of external devices being much sower than internal
How do IO modules detect errors?
- report errors to the cpu
- mechanical or electrical malfunctions reported by device
- unintentional changes to bit pattern as it is transmitted from devices to IO module
Difference between IO modules vs device drivers?
- IO modules are hardware connected to the bus
- device driver is a piece of software which takes sole responsibility for all communications with the IO modules or with one, or many, devices connected to it
What are the steps involved in transferring data from an external device to a cpu
1) CPU asks IO module to check status of device
2) IO module returns device status
3) if ready, CPU requests transfer of data
4) IO module obtains a unit of data from the device
5) Data transferred from IO module to cpu
What is polling?
- cpu is executing a program and encounters an instruction relating to IO operation
- cpu executes that instruction by issuing a command to appropriate IO module
- IO module performs requested action based on IO command
- IO module sets appropriate bits in IO status register
- CPU periodically checks status of IO module until it finds that operation is complete
Pros and cons of polling
- simple
- cpu has direct control
- very little hardware support
- cpu must periodically poll the module to check status
- ties up cpu for long period with no useful work
- cpu slowed to the speed of the peripheral
What is an interrupt?
- cpu issues read command
- IO module gets data from peripheral whilst CPU does other work
- IO module interrupts the CPU
- CPU requests data
- IO module transfers the data
Pros and cons of interrrupt?
- fast
- efficient
- tricky to write
- Done by hardware manufacturer
- still requires active interaction of cpu for data transfer between memory and IO module
What is DMA
- requires DMA controller on system bus
- takes IO communication over from cpu
- cpu grants authority to read from or write to memory
- relieves cpu to do other things
- DMA sends interrupt when task is complete
- cpu is only involved at beginning and end of transfer
- used for large data movement
What is the high performance architecture
- if many devices are connected to the bus
- data transfer demand approaches capacity of bus
- bus becomes bottleneck
- the solution is to use multiple buses laid out in a hierarchy
How do modern PC’S connect buses
- Northbridge = fast, connects direct to CPU, RAM, PCIe, GPU
- Southbridge = slower, all other IO modules, migrated onto single chip
- both are speed bottlenecks
How has IO changed over the years?
- used to be that each device needed own module, which required its own IRQ line, which required it own IO level driver
- painful to set up
- today standard lower level bus has a single IO module (USB etc), which has single IRQ and single IO level driver
- high speed level drivers then talk to devices directly over this
- eg; USB sound card has no direct line to CPU
What is PCIe bus
- peripheral component interconnect express
- general purpose for internal peripheral devices (graphics, networking, sound, video capture
- replacing old versions
- 1 to 32 lane versions
- speed versions (2GB-16GBs per lane)
- not a bus, actually a mesh network
What is a serial port
- ancient/classic point-point comes between 2 devices
- not a bus
- speed = 75-115200b/s, often 9600b/s
What’s USB
- standard for connecting peripheral devices
- not a bus
- replaced a variety of of earlier interfaces
- different versions and speeds; USB1: 12 Mpbs - USB3 5Gbps
- USB hubs, master and slave layout
What are differential signals
- USB has 4 physical wires, 5v
- bits represented by differential voltage between 2 wires
- these wired contain same information mirrored high-low
- this makes wires immune to external electrical fields
- especially when they are twisted together
What is IEEE1394
- FireWire
- competitor to USB
- unlike USB is an actual bus
- single channel shared by all devices, messages ID by device addresses and controlled for collisions
- can daisy chain where as USB cannot
- no fixed master, any device can take master role
What is SCSI
- old, 1980’s
- bus for mass storage devices (hard discs)
- pioneered moving logic and work from cpu into IO module
- reliable but expensive (used today in servers)
What is SATA
- competitor to SCSI
- serial ATA
- cheaper and simpler
- used in computer systems
What is I^2C bus
- user integrated circuit bus for connecting chips together
- common in robotics
- two wires (data and clock)
- Multi-master, multi-slave
- master:generates clock, initiates comes
- slave: replies to maser
- basic message collision avoidance: only talk if the bus is free
What is practical I^2C
FTDI chip
- standard way to access I2C from user code (for robotics)
- run serial port over USB in FTDI, convert to I2C