01-CSL-part-one (2)
01-CSL-part-one (2)
Language:
Introduction & Basics
Hossein Asadi ([email protected])
Department of Computer Engineering
Sharif University of Technology
Fall 2024
Copyright Notice
• Some Parts (text & figures) of this Lecture
adopted from following:
– Computer Organization & Design, The
Hardware/Software Interface, 4th Edition, by D.
Patterson and J. Hennessey, MK pub., 2012.
– “Intro to Computer Architecture” handouts, Dept of
ECE, CMU, by James Hoe, 2009.
– “Computer Organization I” handouts, Dept of Computer
Science, FSU, by X. Liu, Fall 2007.
– “Computer Organization & Design” handouts, by Prof.
Kumar, UIUC, Fall 2007.
– “Machine Structures” handouts, by Prof. D. Garcia,
UCB, Spring 2010.
Slide 2
Today’s Topics
• Course Introduction
• Class Policy
• Course Syllabus & Objective
• Introduction to Computer Organization
• Computer History
• Moore’s Law
Slide 3
Course Introduction
• Instructor: Hossein Asadi
• Classes
– Sat & Mon: 13:30~15:00
• Attend class on time
• Office Hours
– Can be reached by email & skype or stop by my office
(Room # 610)
– Email: [email protected]
• Sat. through Wed.: 9AM ~ 6PM
• TAs Classes
– TBD
Slide 4
Course Introduction (cont.)
• Course Webpage on CW
– Check this webpage on regular basis
• At least on Sun, Tue, Thur
• Q&A only using CW forums
– Everything will be posted on CW
• Announcements, handouts, assignments, grades,
quiz and exam notices, simulators, …
– Handouts
• Will be posted a day before class
– Print it & bring it to class
• But I may update it a day after class
– Check out submission date of handouts
Slide 5
Teaching Assistants
• TA Administration, Grades, CW, HW Schedules,
Comments on TAs
– Ali Sedaghatgoo (Chief TA)
• Computer Org. & History, ISA, Memory & I/O
– TBD (Head TA)
Slide 6
Teaching Assistants (cont.)
• MIPS Assembly Programming, 8086
Programming, Inline Assembly, Device Driver
– TBD (Head TA)
Slide 7
Teaching Assistants (cont.)
• Addressing Mode, Compiler, Assembler, Linker,
Number Representation, Arithmetic & FP, &
Interrupt
– TBD (Head TA)
Slide 8
Few Notes on Assignments
• Post All your Questions on CW Forums
– Check forum history before posting any question
• Be Respectful to your Classmates and TAs
• Harsh Cheating Penalty
Slide 9
Textbook
• Computer Organization & Design, The
Hardware/Software Interface, 4th Edition, by D.
Patterson and J. Hennessey, MK publishing,
2012.
– You can keep textbook for “Computer Architecture”
course, too!
Slide 10
Syllabus
• Computer History
• Computer Organization
– Hardware & software components
– CPU, ALU, registers, buses, I/Os, and memory
subsystem
– Von Neumann model
– Stored program concept
– Introduction to Memory Organization
Slide 11
Syllabus (cont.)
• Computer Language
– Instruction Set Architecture (ISA)
– MIPS instruction set
– Addressing modes in assembly lang.
– MIPS assembly language &
programming
• Subroutines, directives, macros, assembler
& linker
– Introduction to Intel IA-32 ISA
• 8086 Programming
• Inline assembly
Slide 12
Syllabus (cont.)
• Compiler, Assembler, Linker, & Loader
• Computer Arith./Logical Operations
– Number representation (integer &
floating-point)
– Addition, subtraction, multiplication,
division
– Logical operations
• Interrupts & I/O Transactions
Slide 13
Class Policy
• Ask Questions Anytime
– Don’t hesitate to ask even stupid questions!!!
• Cell Phones off or on Silent
• Absence
– Three sessions allowed
• Food No, Drink yes!
• Feel Free to Pass Me Your Feedbacks
– Anything related to this course
Slide 14
Class Policy (cont.)
• Assignments
– Three late assignments will be accepted!
• Only two days late!
• Fourth late assignment (two-day late)
–HW will be graded out of 50%
• Fifth and next late assignments will not be
accepted!
– Discussions encouraged!
– But do your own handwriting!
– Zero score for copied assignments!
• Second time zero score for 30% share!
Slide 15
Objective
• Understand organization of existing
computer systems
• Understand number representations in
computer
• Improve SW performance by writing your
own assembly code
– Introduction to assembly code optimization
– Basic optimizations performed by compilers
Slide 16
Objective (cont.)
• Understand MIPS instruction set
– Be able to encode and decode MIPS
instructions
• Be able to read and write functions using
MIPS assembly language
• Understand different types of instruction set
architectures
– MIPS, Intel IA-32
• Understand how assembler & linker works
• Understand instruction execution flow
Slide 17
Computer Systems:
From Embedded to Enterprise Systems
Slide 18
Objective (cont.)
• By end of semester, you should be able to
answer these questions:
– What is difference in representations of
integers, fixed-point & floating-point numbers?
– What is difference between MIPS and Intel
IA32 instruction sets?
– How recursive procedure calls like “factorial” or
“Towers of Hanoi” are implemented in MIPS
assembly language?
Slide 19
Objective (cont.)
• By end of semester, you should be able to
answer these questions:
– What is best application of different addressing
modes?
– What is difference between load/store
architecture and CISC architectures?
– Why opcode of MIPS ISA is not 4- or 8-bit?
– How a simple assembly instruction is encoded
in machine code (e.g., “add $s0, $s1, $s2”)?
Slide 20
Objective (cont.)
• By end of semester, you should be able to
answer these questions:
– How much stack will be used when calling
fact(20)?
– Difference between Dynamically Linked Libs
(DLL) and Statically Linked Libs?
– Difference between IO-mapped-IO and
memory-mapped-IO?
– How 1010 and (1010 +1) represented in FP?
– Simple optimizations used in compilers?
Slide 21
Grading
• Midterm Exam: 25%
– Aban 19th
• Final Exam: 35% (as posted in EDU)
• Quiz (1&2): 15%
– First quiz: Mehr 28th
– Second quiz: Azar 24th
– Up to three additional unscheduled quizzes
• Assignments & Project: 30%
– Bonus points for outstanding projects
• Exams: Topics of this Class and TA Classes
Slide 22
Today’s Topics
• Introduction to Computer Organization
• Computer History
Slide 23
Copyright Notice
• Parts of lectures adopted from:
– Computer Organization & Design, The
Hardware/Software Interface, 4th Edition, by D.
Patterson and J. Hennessey, MK pub., 2012.
– “Intro to Computer Architecture” handouts, Dept of
ECE, CMU, by James Hoe, 2009.
– “Computer Organization I” handouts, Dept of Computer
Science, FSU, by X. Liu, Fall 2007.
– “Computer Organization & Design” handouts, by Prof.
Kumar, UIUC, Fall 2007.
– “Machine Structures” handouts, by Prof. D. Garcia,
UCB, Spring 2010.
Slide 24
Introduction
• What Is a Computer?
– An electronic device capable of storing and
processing information in accordance with a
predetermined set of instructions
• Oxford English Dictionary
– A machine that manipulates data according to a set of
instructions
– A general purpose device that can be programmed to
carry out a set of arithmetic or logical operations
• Wiki
Slide 25
Introduction (cont.)
• Where are Computers?
– PCs
– Cars
– Toys
– Home appliances
• Microwaves, refrigerators, TVs
– In your pocket ☺
• Cell phones, IPoDs, MP3 players
– Or maybe in your shoes!!!
Slide 26
Introduction (cont.)
• Where are Computers?
Slide 27
Computer System
• A computer system consists of hardware and
software that are combined to provide a tool to
solve problems (with best performance)
– Hardware may include:
• CPU, memory, disks, printers, screen, keyboard, mouse
• Other peripherals
– Software may include:
• System software
– A general environment to create specific applications
• Application software
– A tool to solve a specific problem
Slide 28
Computer System (cont.)
• Most complicated machines ever built on
the earth
– For example (BT: Billion Transistors)
• Intel 22-core Xeon Broadwell-E5: 7.2 BT
• Nvidia GPU GV100 Volta: 21 BT
• AMD Epyc Rome: 32 BT
• Xilinx Everest/Versal FPGA: 50 BT
• Samsung 128 Gb SDRAM (DDR4): 137 BT
• Samsung 8Tb 4-bit V-NAND Flash: 2048 BT
Slide 29
Computer System (cont.)
• Most complicated machines ever built on
the earth
• A Boeing airplane has only 4 million parts
• How can we comprehend these computer
systems?
– Using hierarchical abstraction levels
Slide 30
Computer System (cont.)
• Hierarchical Abstractions
– Applications
– Systems software
– Assembly/machine language
– Architectural issues
• i.e., caches, virtual memory, pipelining
– Boolean logic, 1s and 0s
• Sequential logic, finite state machines
• Combinational logic, arithmetic circuits
– Transistors used to build logic gates (CMOS)
– Semiconductors/silicon used to build
transistors
– Properties of atoms, electrons, and quantum
dynamics
Slide 31
Instruction Set Architecture
• Our Focus in this Course:
– SW/HW Interface
– Known as Instruction Set Architecture (ISA)
• ISA
– A very important abstraction
– Interface between hardware and low-level
software
• Modern Instruction Set Architectures
– IA-32, PowerPC, MIPS, SPARC, ARM, …
Slide 32
Computer Organization
• Computer Components
– Input, output, memory, control unit, & datapath
Computer
Control Input
Memory
Datapath Output
Slide 33
Types of Computer Systems
• Desktops
• Servers
• Embedded Systems
Slide 34
Types of Computer Systems (cont.)
• Desktops
– General purpose computers
– Variety of software
– Designed for use by individuals
• PCs, Notebooks
Slide 35
Types of Computer Systems (cont.)
• Servers
– High-end computing systems
• Consists of several CPUs
– Used by multiple users
– Networked based
– High capacity, performance, reliability
– Range from small servers to building sized
Slide 36
Types of Computer Systems (cont.)
• Servers
– Supercomputers highest performance servers
• Hundreds of CPUs, TBs of memory, PBs of
storage
Slide 37
Types of Computer Systems (cont.)
• Embedded Systems
– A computer system designed to perform one or
a few dedicated functions
• Often with real-time, power, high reliability,
low-cost, size/weight constraints
– Hidden as components of systems
Slide 38
Types of Computer Systems (cont.)
• Embedded Systems
– Widest range of applications!
• Telecommunications systems: routers, …
• Consumer electronics: cell phones, PDAs,
MP3 players, digital cameras, printers, fax
machines, …
• Transportation systems: cars (ABS, airbag
controller, …), aircrafts, …
• Medical equipment
Slide 39
Types of Computer Systems (cont.)
• Embedded Systems
– Q1: Embedded systems are special-purpose
designed; why?
• To further reduce cost and power
– Q2: Is performance a major metric?
• As long as we satisfy real-time constraint
• Further performance increase not desired
Slide 40
Computer Organization (cont.)
• Components of a Desktop System
– Processor
– Memory system
– Power supply
– Cooling system
– Motherboard
– I/Os
• Disk drive , network card (on-chip), video
card (on-chip), keyboard, mouse, printer,
mouse, camera, …
Slide 41
Computer Organization: Inside the Box
Slide 42
Computer Organization (cont.)
• Components of an Embedded Computer
– Processor
– Memory system
– Power supply
– Cooling system
– Sensors
– Converters
• Analog-to-Digital Converter (ADC)
• Digital-to-Analog Converter (DAC)
– Actuators
Slide 43
Computer Organization (cont.)
• A Typical Computer Org.
Slide 44
Inside the Processor (CPU)
• Datapath
– Performs operations on data
• Control
– Sequences datapath and memory accesses
• Cache memory
– Small fast SRAM memory for immediate
access to data
Slide 45
Inside the Processor (CPU)
• AMD Barcelona: 4 processor cores
Slide 46
Computer Organization (cont.)
• A Typical Embedded Computer
Slide 47
Market: Application
Slide 48
Market: Application (cont.)
Slide 49
Market: CPU Brand
Slide 50
Computer History: General Overview
• Non-Electronic Computing Machines
– Abacus
– Punch machine
– Difference engine
– Analytical engine
• Electro-Mechanical Computers
• Electronic Computers
Slide 51
Computer History
• Generation -1: The early days ( ? - 1642)
• Generation 0: Mechanical (1642 - 1945)
• Generation 1: Vacuum tubes (1945 - 1955)
• Generation 2: Discrete transistors (1955 - 1965)
• Generation 3: Integrated circuits (1965 - 1975)
• Generation 4: VLSI (IC) (1975 - 2005)
• Generation 5: ULSI (IC) (2005 - present)
1. http://www.answers.com/topic/history-of-computing-hardware
2. http://www.answers.com/topic/history-of-computing-hardware-1960s-present
3. http://web.njit.edu/~ziavras/Ziavras-
history.pdf#search=%22computer%20history%2Bpentium%2Beniac%2Bquantum%2
Bfiletype%3Apdf%22
4. http://inventors.about.com/library/blcoindex.htm
• A portion of the
Difference Engine
holds in the
Powerhouse Museum
in Sydney, Australia
• Programming Problems:
– Nothing was stored in memory
• Program Storage
became very important
– a program/data memory
– a controller,
• Instruction execution:
– 1.2 milliseconds
http://www.computermuseum.li/Testpage/IntroToVacuumTubes.htm
Generation 2:
Discrete Transistors
IBM:
• 1953 - the IBM 701
– IBM’s first stored program computer
– Scientific calculations
Slide 79