Computer Systems

  • Input devices
  • Output devices
  • Computer architecture
  • Memory and storage

Analog

Data represented in continuous values

Varying voltage level in signal cable

Computer cannot directly handles analog data

Require ADC to convert from Analog to digital or DAC to convert to anlaog

Digital

Data represented in discreet values

 

Computer can only handle digital signal directly

Microphone

  • The diaphragm (2) is moved by the air molecule (1)
  • That makes the coil (4) to create varying electric current depends on the loudness of sound
  • Analog signal out (5)

Analog sound signal

Digital sound

Resolution (number of steps in power)

Sampling rate

(Number of Steps in time)

Application of Mic

  • Recording sound
  • Speech recognition
  • ...

Telephone banking

QR Code

Think Pair Share

  1. Try to list applications of QR Code in your notebook

QR Code

  • Quick Response Code
  • Store a very large amount of data compare to usual barcode
    • Up to 7000 numbers / 1000 characters vs 30 numbers
  • Able to have error detection and recovery, small damage on the code can still be scanned

Think Pair Share

  1. Give 2 advantages and 1 disadvantages of QR Code compare to Barcode [3], write in notebook. 

Input device

  • Gathers data for the computer to process
  • Three major types:
    • Human input
    • Direct data entry
    • Sensors (require ADC)

Output device

  • Converts info. from computer to physical form

Output Devices

Monitors

  • Most common type of output device
  • Major types of flat-panel monitors:
    • LCD
    • LED
    • OLED

Color components in a monitor:

#RRGGBB

LCD/LED Screen

  • The orientation of liquid crystal can be controlled by electricity
  • Thus affects the back light to pass through or not
  • Light will be filtered by the color filter to display individual color
  • LCD uses CCFL (fluorescent) as back light, while LED is using LED as light

Research

  • What are the benefits of LED backlight (LED Monitor) compare to CCFL backlight (LCD Monitor)?
  • What is the difference between LED and OLED display?
  • Which type of screen panel is suitable for smartphones? Why?

Projector

  • LCD Projector
    • LCD screen is illuminated by a powerful backlight
  • DLP Projector
    • Micro mirrors to deflect the light from the screen or to the screen

Printers / Cutters

  • Inkjet printer
  • Laser printer
  • 3D Printer
  • 2D and 3D Cutters 

Inkjet printer

  • A moving print head sprays ink droplets on to the paper from a cartridge filled with liquid ink

Laser printer

  • The rotating printing drum is given a positive charge.
  • A laser removes the positive charge from certain areas of the drum as it scans across it, creating a negatively charged copy of the text/image to be printed.
  • On an ink roller, the toner is given a positive charge which attracts it to only the negatively charged areas on the printing drum.
  • The toner then transfers from the negatively charged areas of the drum to some positively charged paper. 

https://www.youtube.com/watch?v=_UOU5_4fnzs

Inkjet Laser
Application

 
Price (machine)
Cost (Consumable)
Advantages

 
Disadvantages

 

3D Printers

  • Create 3-dimensional object from a computer model
  • Usually a computer model is created by CAD (Computer aided design) software or from 3D Scanner
  • Usually refers to Additive manufacturing
  • 3D objects are created by layering a material, layer by layer

2D/3D Cutter

  • Computer controlled the cutting tool to cut on the stock material
  • It refers as subtractive manufacturing
  • Examples of 2D cutter:
    • Laser cutter
    • Waterjet
  • Examples of 3D cutter:
    • CNC (Computer numeric control) Mill / Router

Compare 3D Print / 3D Cutter

3D Print 3D Cutter
Materials
Speed
Cost
Usages
 
Other advantage

 
Some parts are impossible to create using traditional manufacturing process
Lighter parts due to special structure
Can achieve a very high precision

Computer Architecture

Early computers

  • Difference Engine - Charles Babbage
    https://www.youtube.com/watch?v=BlbQsKpq3Ak
  • Machine is purposely built, only able to perform certain tasks
  • ENIAC - First general purpose computer
    https://www.youtube.com/watch?v=bGk9W65vXNA
  • Allows reprogram (through hardware) the computer for different tasks

Von Neumann architecture

  • Stored-program computer - not only data is stored in memory, but also instructions
  • Modern computer stores instructions as well as data in RAM
  • Benefits of Von Neumann architecture:
    •  

Main components in the architecture

  • CPU (Central processing unit) contains:
    • Arithmetic Logic Unit (ALU) - Logical comparisons and calculations
    • Control Unit (CU) - controls flow of data and different components in CPU
    • Registers - Internal memory within CPU. Holds data and instructions during processing
  • Buses - Connecting components for exchange of information. There are:
    • Control bus
    • Address bus
    • Data bus

Examples of Registers

  • Program counter
  • Instruction register
  • Address register
  • Accumulator

Fetch-Execution cycle

  • Tryout: Little Man Computer
  • Processor fetch one instruction by one
  • Execute the instruction after decoding it
  • Refer to p.49 in textbook for detail (note you don't need to memorize the whole process)

High-level and Low-level (programming) languages

Machine code

  • The code that is directly understand by CPU
  • Represented in binary numbers

Assembly language

  • Low level programming language
  • Machine specific - only CPU of the same architecture can use
  • Can directly translate into Machine code, for CPU to run - using translator

Assembly

Machine code

High-level languages

  • More human readable codes
  • Allows programmers to focus on solving problems
  • Usually not platform specific - the program code can be used in many different models of computer
  • Some examples (from lowest level to highest)
    • C
    • C++
    • Java
    • Python
    • Javascript

Translators

  • CPU can only understands machine code, therefore translators is needed to translate from programming languages
  • Examples are:
    • Assemblers: for assembly languages
    • Compilers
    • Intrepreters 

Assemblers

  • To translate assembly language into machine code
  • Translation is more or less one-to-one mapping
  • i.e. One line of assembly code became one single machine code instruction

Compilers

  • Translate higher level languages to machine code
  • Compiler will read the whole program, translate into machine code, and save as executable file
  • Any syntax error in the code will stops the compilation and error message will display for the programmer to fix
  • Examples of languages that needs compiler:
    • C++
    • Java

Interpreters

  • Directly reads the code written in high level languages and instruct the computer to run
  • Read and execute code one by one
  • Will not store machine code
  • Syntax errors usually not found until that line of code is executed
  • Intrepreter must be installed to run such programs
  • Usually refer as script languages, for example:
    • Python
    • Javascript

Main Memory

Memory unit (RAM)

  • Made up of partitions
  • Each partition has it's own address and contains content
  • Usually each partition is 8 bit in content (1 byte)
  • How many bits in each memory partition (content)?
  • 8
  • How many bits in each memory address?
  • 32
  • What is the maximum size of a 32 bit address? Show your working.

 

Study the memory illustration of a certain computer:

RAM: Random Access Memory

ROM: Read Only Memory

Firmware: ROM that holds programs to run on embedded computer

Bootstrap: ROM that contains startup instruction for computer

EPROM: Erasable Programmable ROM

Flashing: the process of erasing and rewriting data to ROM

RAM

  • Random access memory
  • Allows read and write of the content
  • Volatile, temporary (working) memory for modern computer
  • If RAM is full, modern Operating System will move data to HDD or other secondary storage devices
    • thus only keep those running program in RAM
    • too many running program will be v. slow
  • Examples of RAM are DRAM and SRAM

Types of data access

  • Sequential access
  • Random Access / Direct access

from: wikipedia

ROM

  • Read Only Memory
  • Non-volatile / permanent memory
  • Often store startup instructions for the computer:
    • Firmware: for embedded computer system
    • Bootstrap: for general purpose computers
      • Basic Input Output System (BIOS)
      • UEFI - replace BIOS and often found in recent PCs

BIOS (left) and UEFI 

EPROM

  • Some types of ROM can be changed, one of them is EPROM (Erasable programmable read only memory)
    • Firmware of devices might need upgrade, e.g. Router
    • BIOS is also upgradable
  • The act to modify EPROM is called flashing

Compare RAM and ROM

RAM ROM
Read/Write
 
Volatile
 
Content
 
Functions
 
Size
 

Secondary Storage

  • Non-volatile
  • Usually holds large amount of data (compare to main memory)
  • Three main types (technology):
    • Magnetic
    • Optical
    • Solid-state

Punch card - one of the earliest storage media

Magnetic storage devices

  • Read and write data by using electromagnets and magnetic fields to control tiny magnetic dots of data
  • Represents 0 or 1 with the polarity of magnetic field
  • Hard disk drive (HDD) stores data on the magnetic disk
    • Most common type of magnetic device
    • Cheap and fast enough
  • Magnetic tape
    • Sequential access, very large in capacity
    • Great for backup large amount of data

Optical storage

  • Optical disc are plastic disks with small pits on it
  • Data is read by shining laser beam onto the surface and detect whether it is pit or bump (thus 1 or 0)
  • Writing data required burning the pit on the surface with higher laser power
  • DVD-RAM / DVD-RW are rewritable type of optical storage media
CD DVD Blu-Ray
Type of laser
Capacity (typical)
Usage



 

Comparison of Optical Disc

Solid state

  • Solid state storage devices store data electronically (e.g. Flash memory, EEPROM)
  • Unlike magnetic / optical, it involved no mechanical moving parts when read/write
  • Access speed (time to locate required data) is much faster than mechanical media and also data transfer speed
  • Examples are: SSD, Flash memory Drive (USB drive), Flash Memory (SD Card etc.)

HDD (mechanical) vs SSD

HDD SSD
Cost
Capacity
Size and weight
Access speed
Transfer speed
Reliability
Others

 

Create a mind map about storage devices

Calculate storage requirements of a file

Storage unit and conversion

1 byte            bit
1 kilobyte (KB)            byte
1 Megabyte (MB)            KB
1 Gigabyte (GB)            MB
1 Terabyte (TB)            GB

Note: the short form for byte is B while short form for bit is b

Note 2: Storage usually measured in byte, while transfer speed usually in bit per second (bps)

Data to be stored Size in bits / bytes
1 Character in an ASCII text string
1 Pixel in a black and white image
1 Pixel in an 8-bit color image
1 Pixel in a full-color image

Class exercise

Calculate the storage requirements for the following cases:

 

  1. A plain text file containing the following text:
    This is a text file.
  2. A 16x16 black-and-white image
  3. A 16x16 Grayscale (8-bit) image
  4. Uncompressed 2 hour HD
    (1280x720) movie

Revision Questions

[F3CS] Computer System

By Andy tsui

[F3CS] Computer System

  • 350