IT1001 Lecture 2 - Computer Hardware and Software
IT1001 Lecture 2 - Computer Hardware and Software
Lecture 2
Computer Hardware
(Chapters 2 and 3)
2
History of Computer Hardware
Moore’s Law and microprocessing power
Computing power doubles every 18 months:
The number of transistors in a dense integrated circuit doubles
approximately every two years.
3
Information Representation
• Computers can digest information only if it
has been broken into bits
• Bit, or a binary digit
• Smallest unit of information
• Can have one of two values: 0 or 1
• High and low electrical charges
High (On)
Low (Off)
4
Information Representation
• Number system: a way to represent numbers
• Decimal (base 10)
• 10 digits: 0, 1, 2, 3, …, 9
• Binary (base 2)
• 2 digits: 0, 1
• Octal (base 8)
• 8 digits: 0, 1, 2, 3, …, 7
5
Number System
Number System Base 3rd Position 2nd Position 1st Position
6
Number System
• Idea: Use the position and the numerical
value to represent a number
• Consider Decimal (Base 10) case
7 8 6
6 x 100 =6x1 = 6
8 x 101 = 8 x 10 = 80
Position 22 21 20
1 0 1
1 x 20 =1x1 =1
0 x 21 =0x2 = 0
1 x 22 =1x4 =4
510
8
Binary vs Decimal
• Binary (Base 2) case
9
Converting Binary to Decimal
• Binary to Decimal
• Examples: 101011012
1 0 1 0 1 1 0 1
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
128 + 32 + 8 + 4 + 1 = 17310
10
Converting Decimal to Binary
• Decimal to Binary
• 2 methods
• Comparison with descending powers of 2 and
subtraction
• Division by 2 with remainder
11
Converting Decimal to Binary
• Decimal to Binary
• Example: 17310
• Comparison with descending powers of 2 and
subtraction
position 9 8 7 6 5 4 3 2 1
28 27 26 25 24 23 22 21 20
256 128 64 32 16 8 4 2 1
1 0 1 0 1 1 0 1
12
Converting Decimal to Binary
• Decimal to Binary
• Example: 17310
• Division by 2 with remainder
2) 173 1
2) 86 0 173 / 2 = 86 with remainder 1
2) 43 1 86 / 2 = 43 with remainder 0
2) 21 1
2) 10 0 Read off the binary number
2) 5 1 starting from the bottom
2) 2 0
2) 1 1
Make sure you only stop
0 when the quotient is 0
13
Bits as Codes
• Coding Scheme
• Combination of bits (0 and 1) to represent information
(numbers, letter, special characters etc)
• E.g.
• ASCII (American Standard Code for Information
Interchange)
• Use 8 bits
• 28 = 256 characters
• 256 characters including special
symbols etc
• ‘A’ and ‘a’ treated as different
characters
• Idea: Representing a character
with a number
14
https://www.branah.com/ascii-converter
ASCII Activity
15 70 85 78
Bits as Codes
• ASCII only allows for 256 characters
• How do we represent non-English characters
then? E.g. Chinese characters?
• Unicode (UTF-8, UTF-16, UTF-32)
• Coding scheme that supports more than 100,000
unique characters
16
Bits as Instruction in Programs
• Fundamentally, computer programs are just
collections/string of bits
• 1010101111
1011101111
1010101011
1110111111
1010101101
17
Bits as Codes
• What does it mean?
01011010
18
A Bit about Bits
19
Byte
20
Byte
21
Computer Hardware
• Four functional specialization
• Receive input
• Input devices
• Process information
• Microprocessor (CPU)
• Produce output
• Output devices
• Store information
• Memory and storage devices
22
“Onboard Devices”
Computer
Hardware
“Onboard
Peripherals
Devices”
Central
Motherboar Buses, Ports Input Output
Processing Memory Storage
d and Slots devices devices
Unit (CPU)
23
Motherboard
• Main circuit board
• Holds various
hardware
components
• CPU, memory, ports,
slots
• Information (bits)
travels between
components on the
motherboard through
groups of wires called
(internal) buses
24
“Onboard Devices”
Computer
Hardware
“Onboard
Peripherals
Devices”
Central
Motherboar Buses, Ports Input Output
Processing Memory Storage
d and Slots devices devices
Unit (CPU)
25
Central Processing Unit (CPU)
• The CPU
• “Brain” of computer
• Performs the transformations
of input into output
• Interprets and executes the
instructions in each program
• Performs arithmetic and logical
data manipulations
• Communicates with all the other
parts of the computer system
indirectly through memory
26
The CPU
• Main Components
• Arithmetic and logic
Unit (ALU)
• Decode Unit
• Control Unit (CU)
• Bus Interface Unit
• Cache
27
The CPU
28
The CPU
• Decode Unit
• Reads the instructions
(from the memory)
and translate them to
the right form
• E.g.,
Determine
• Operations
• Operands
29
The CPU
• Control Unit (CU)
• Receive the decoded
instructions and provide
additional information
for the ALU or other
components
• E.g.,
CU tells ALU what
operation to do
(Add or sub etc)
30
The CPU
31
The CPU
• Caches
• Different components
often contain caches
Reading from/storing to
• E.g., Prefetch unit to register is much faster than
speed up the processing RAM
• Why?
• There are differences in
the speed of different
“storage” components
(e.g., Cache, RAM,
register, hard disk)
32
Indicators of a CPU
• Clock speed
• Speed of the internal clock
• The timing device that sets the pace for executing
instructions and produces electrical pulses to
synchronize the computer’s operations
• Clock cycles per second, measured in gigahertz
(GHz): a billion cycle per second.
• GHz: Determines how fast instructions are
executed
• Word size
• Numbers of bits the CPU can process at one time
• Typically 32-bit, or 64-bit
33
Indicators of a CPU
• Cache size
• Cache is used to reduce CPUs that run simultaneously
memory access time by CPU on a single chip
• Faster than RAM
• L1(Level 1), L2, L3
• L1 size much smaller than L2
or L3
(32KB, 512KB-4MB)
• Front Side Bus speed
• Design & Architecture
• Number of Cores
• Control unit and ALU
34
The CPU
Benchmark Tests
35
“Onboard Devices”
Computer
Hardware
“Onboard
Peripherals
Devices”
Central
Motherboar Buses, Ports Input Output
Processing Memory Storage
d and Slots devices devices
Unit (CPU)
36
Buses
37
Expansion slots
• Expansion slots
• Users can customize
their computers by
inserting special-purpose
circuit boards (called
expansion cards) in Graphics Card Sound Card
these slots
• Expansion cards
• E.g., graphic card,
network interface card,
TV card, sound card, etc
Network Interface Controller (NIC) Card
38
Ports
• Sockets on the outside of CPU chassis for
connecting external devices
• E.g., keyboard, mouse, monitor, printer
S-Video
Onboard Ports
Ports from
expansion
cards DVI
39
“Onboard Devices”
Computer
Hardware
“Onboard
Peripherals
Devices”
Central
Motherboar Buses, Ports Input Output
Processing Memory Storage
d and Slots devices devices
Unit (CPU)
40
Memory
• Read-Only Memory (ROM)
• Non-volatile
• Information is stored permanently on a chip
• Available whenever the computer is operating
• Cannot be change, except by replacing the chip
• Stores start-up instructions and other critical
information
• Firmware
• When a program is immortalized on a silicon ship
41
Memory
• Random Access Memory (RAM)
• Random Access
• Data can be stored and retrieved at any location on the
memory chip
• Retrieves information fast, speed is lower than
cache/register but faster than secondary storage
• Holds data and programs that are currently
running in the computer
• Volatile Temporary
Memory
• How memory works
43
Information Storage Devices
Computer
Hardware
“Onboard
Peripherals
Devices”
Central
Motherboar Buses, Ports Input Output
Processing Memory Storage
d and Slots devices devices
Unit (CPU)
44
Memory
• Primary storage
• “working area” for storing data for manipulation
• Directly connected to the CPU
• CPU communicates with all other parts of the computer
system indirectly through memory
• At the core of a computer together with CPU
• E.g., RAM, ROM, register, cache
45
Storage Devices
• Secondary storage
• Non-volatile (permanent), services as long-term
repositories for data
• E.g., Hard disk, CD, DVD, tapes, flash memory
46
2019/20 Semester 1
Lecture 2
Computer Software
(Chapters 4 and 5)
Hyelim Oh, PhD
[email protected] | 6516 6732 | COM2-0415
48
Hardware vs. Software
• Computer hardware
• Physical components for computational operations
• Deals directly with 0s and 1s
• Software
• Sets of computer instructions designed to solve problems
• Provides rules of processing information
49
Software Languages
• How do we write software? 000000 00001 00010 00110 00000
100000
000000 00001 00010 00110 00000
• Machine language 100001
• Numeric representations of 1s and 0s to represent basic
computer operations
Or
• High level language
• Fall somewhere between natural human languages and
precise machine languages
• E.g., C, Java, C++, C#, Python
50
Software Languages
• For a computer to understand a program
written in high-level language
• A translator program is needed to convert the
English-like instructions to the 0s and 1s of
machine language
• Compiler
• The most common type of translator program
• Compiles a complete translation of the program
before it runs for the first time
• The compiled program can run again and again
• When the program need to be recompiled?
• Instructions need to be changed
51
Software Languages
Executable file
A computer program that is carried out step-by-
step within the microprocessor
Name extension
.exe
.app
.dmg?
52
Major Categories of Software
Software
System Application
software software
53
Major Categories of Software
• System software
• Manage system tasks
and resources
• Two types
• Operating systems (OS)
• Coordinates functions of
hardware (e.g., I/O)
• Supports application
software
• Utility software
• For maintenance
purposes (e.g., check
for virus)
54
Major Categories of Software
• Application software
• Adds capabilities to the computer
• Serves as productivity tools to help computer
users solve problems
• Many different types
• e.g., word processing, presentation, etc
55
Major Categories of Software
Software
System Application
software software
56
Operating System (OS)
• Keeps computer hardware running efficiently
and makes the process of communication with
the hardware easier
• Functions
• Maintains the file systems that keep track of the
location of all programs and data files
• Manages resources (e.g., hardware devices,
memory) and application software
• Handles information from input and output devices
(e.g., communicates with device drive software)
• Provides user interface (as a means of
communicating with user)
57
Operating System (OS)
In a nutshell
Monitor and controls all I/O processing activities
within a computer system
Manages all hardware & application software
Where the OS lives?
ROM?
RAM?
Hard disk?
58
Operating System (OS)
time
63
Operating System (OS)
Task manager (Windows)
64
Operating System (OS)
Activity Monitor (Mac)
65
Operating System (OS)
• Multiuser
• The OS responsible for authentication and
authorization
• Authentication
• Determining that users are who they claim to be
• E.g., requiring login name and password
• E.g., fingerprint
• Authorization
• Ensuring that users have permission to perform a particular
action
• E,g., allowing only those with administrative privileges to
install/uninstall application programs
66
Operating System (OS)
• Interfaces
• From character-based interface (access through
Windows – “Command Prompt”)
• To graphical user interface (GUI)
67
Operating System (OS)
• Interfaces
• 1984 Mac GUI
68
Operating System (OS)
• Types
• Desktop OS
• E.g., Windows, Mac OS
• Mobile OS
• E.g., Android, IOS
• Server OS
• Linux, UNIX, Windows Server, mac OS server
• Multi-user OS
69
Virtual Machines
A virtual machine allows one computer to
simulate the hardware and software of
another.
E,g., Run Windows on a Mac
Popular virtual machine software
Also called hypervisor
E.g., VMware Workstation, VirtualBox
Benefits:
Reduces hardware and power expenditures
70
Running Windows on Mac
71
Tutorials
Two flavors
1) Lecture review
2) Lab exercises
Web authoring
Software: Dreamweaver
Descriptive analytics using Excel
Intro to programming using Python
Software: Anaconda python, PyCharm