You are on page 1of 24

L01

03/01/2018

CS104: Computer Organization


Lecture 01, 3rd January, 2018
Dip Sankar Banerjee
Computer Organization
dipsankarb@iiitg.ac.in (IS F242)
Lecture 1 : Introductory Thoughts

Dip Sankar Banerjee


dsb@hyderabad.bits-pilani.ac.in
Department
Indian Institute of CS &Technology,
of Information IS Guwahati
Jan-Apr 2018
L01
03/01/2018

Some pre-requisites
• UG courses on
– Programming in C/C++, Python, Java
• No TAs for the course
– You should take initiative to solve problems on
your own
L01
03/01/2018

Intended Learning Outcomes


• What are you expected to do after the course?
– Remembering: Describe, define, draw, recite, quote, name, tell,
write
– Understanding: Classify, compare, exemplify, conclude,
demonstrate, illustrate, interpret.
– Applying: Apply, change, choose, compute, dramatize, implement,
prepare, produce.
– Analysing: Characterize, compare, contrast, debate, deduce,
differentiate, distinguish, examine.
– Evaluating: Appraise, argue, assess, choose, justify, predict,
prioritize, prove, rank, monitor.
– Creating: Construct, design, develop, generate, invent, compose,
plan, make, hypothesize.
• Source : Bloom’s Taxonomy. Anderson and Krathwohl (2001)
L01
03/01/2018

Assessment
• 20% Class Tests/Assignments
• 60% Exams: (1 midterm 25% and end semester
35%)
• 20% Lab Exams: (Two graded evaluations for 50
points to be held in last tutorial class before mid-
semester and end-semester)
• ?% Class Participation: Participation (i.e. not just
attendance) classroom discussions and online
forum for course
L01
03/01/2018

Academic Integrity

• Be careful about:
– Verbatim reproduction from external resources
– Paraphrasing from earlier work
– Disrupting classroom activity
– Cheat, copy, and collaborate on assignments
• Participate in discussions
– There are no “stupid” questions 
– Be considerate of your fellow classmates
L01
03/01/2018

Welcome
 To the path of understanding the engineering in
Computer Science Engineering.
 To the art of hardware design.
 To the art of abstractions.
 To the world of systems.
L01
03/01/2018

Pervasive Idea
 Abstraction: only way of dealing with complex systems
 Divide world into objects, each with an…
 Interface: knobs, behaviors, knobs → behaviors

 Implementation: “black box” (ignorance+apathy)

 Only specialists deal with implementation, rest of us with

interface
 Example: car, only mechanics know how implementation works

 Layering: abstraction discipline makes life even simpler


 Divide objects in system into layers, layer n objects…
 Implemented using interfaces of layer n – 1

 Don’t need to know interfaces of layer n – 2 (sometimes

helps)
L01
03/01/2018

Pervasive Idea
 Inertia: a dark side of layering

 Layer interfaces become entrenched over time


(“standards”)
 Very difficult to change even if benefit is clear (example:
Digital TV)

 Opacity: hard to reason about performance across


layers
L01
03/01/2018

What is a Computer ?
• Components:
– input (mouse, keyboard, camera, microphone...)
– output (display, printer, speakers....)
– memory (caches, DRAM, SRAM, hard disk drives, Flash....)
– network (both input and output)
• Our primary focus: the processor (datapath and control)
– implemented using billions of transistors
– Impossible to understand by looking at each transistor
– We need...abstraction!

An abstraction omits unnecessary detail,


helps us cope with complexity.
L01
03/01/2018

How do Computers Work ?


• Each of the following abstracts everything below it:
– Applications software
– Systems software
– Assembly Language
– Machine Language
– Architectural Approaches: Caches, Virtual Memory, Pipelining
– Sequential logic, finite state machines
– Combinational logic, arithmetic circuits
– Boolean logic, 1s and 0s
– Transistors used to build logic gates (e.g. CMOS)
– Semiconductors/Silicon used to build transistors
– Properties of atoms, electrons, and quantum dynamics

• Notice how abstraction hides the detail of lower levels, yet gives a
useful view for a given purpose
L01
03/01/2018

Abstraction, Layering and Computers


L01
03/01/2018

Abstraction, Layering and Computers


 Computers are complex, built in layers
 Several software layers: assembler, compiler, OS,
applications
 Instruction set architecture (ISA)
 Several hardware layers: transistors, gates, CPU/Memory/IO
 99% of users don’t know hardware layers
implementation
 90% of users don’t know implementation of any layer
 That’s okay, world still works just fine
 But sometimes it is helpful to understand what’s “under the
hood”
L01
03/01/2018

Computer Architecture

Application
Operating
System
Compiler Firmware

Instruction Set Architecture

Instr. Set Proc. I/O system


Computer
Logic Design
Implementation
Circuit Design
Architecture
Layout
L01
03/01/2018

The Instruction Set: a Critical Interface

software

instruction set

hardware
L01
03/01/2018

Instruction Set Architecture


• A very important abstraction
– interface between hardware and low-level software
– standardizes instructions, machine language bit patterns, etc.
– advantage: different implementations (cost, performance,
power) of the same architecture
– disadvantage: sometimes prevents using new innovations

• Common instruction set architectures:


– IA-32, PowerPC, MIPS, SPARC, ARM, and others
L01
03/01/2018

Instruction Set Architecture


• ISA, or simply architecture – the abstract interface between the
hardware and the lowest level software that encompasses all the
information necessary to write a machine language program,
including instructions, registers, memory access, I/O, …

• ISA Includes
– Organization of storage
– Data types
– Encoding and representing instructions
– Instruction Set (or opcodes)
– Modes of addressing data items/instructions
– Program visible exception handling
• Specifies requirements for binary compatibility across
implementations (ABI)
L01
03/01/2018

Case Study: MIPS ISA


• Instruction Categories
– Load/Store
– Computational R0 - R31
– Jump and Branch
– Floating Point
– Memory Management
PC
– Special
HI
LO
3 Instruction Formats, 32 bits wide
OP rs rt rd sa funct

OP rs rt immediate
OP jump target
L01
03/01/2018

Execution Cycle
Instruction
Fetch Obtain instruction from program storage

Instruction
Determine required actions and instruction size
Decode

Operand Locate and obtain operand data


Fetch

Execute Compute result value or status

Result
Deposit results in storage for later use
Store

Next
Instruction Determine successor instruction
L01
03/01/2018

Levels of Representation
High Level Language temp = v[k];
Program v[k] = v[k+1];
v[k+1] = temp;
Compiler
lw $15, 0($2)
Assembly Language lw $16, 4($2)
Program sw $16, 0($2)
sw $15, 4($2)

Assembler

0000 1001 1100 0110 1010 1111 0101 1000


Machine Language 1010 1111 0101 1000 0000 1001 1100 0110
Program 1100 0110 1010 1111 0101 1000 0000 1001
0101 1000 0000 1001 1100 0110 1010 1111
Machine Interpretation

Control Signal ALUOP[0:3] <= InstReg[9:11] & MASK


Specification [i.e.high/low on control lines]
°
°
L01
03/01/2018

Advantage of HLLs
• Higher-level languages (HLLs)
 Allow the programmer to think in a more natural language and
for their intended use (Fortran for scientific computation,
Cobol for business programming, Lisp for symbol
manipulation, Java for web programming, …)
 Improve programmer productivity – more understandable
code that is easier to debug and validate
 Improve program maintainability
 Allow programs to be independent of the computer on which
they are developed (compilers and assemblers can translate
high-level language programs to the binary instructions of any
machine)
 Emergence of optimizing compilers that produce very efficient
assembly code optimized for the target machine
• Compilers convert source code to object code
• Libraries simplify common tasks
L01
03/01/2018

Processing from Storage to I/O


L01
03/01/2018

Functional View
L01
03/01/2018

Data Movement
L01
03/01/2018

Processing To and From Storage

You might also like