1 of 44

Course outline and Introduction

IT264 Computer Architecture & Microprocessor Interfacing

2 of 44

Outline

  • Course, Attendance, Text and Reference Book
  • What do we study in this course?
  • Why should this be studied?
  • What are “Computer Architecture” and “Computer Organization”?
  • How is the course structured?

IT264 Computer Architecture & Microprocessor Interfacing

2

12/20/2024

3 of 44

IT264 Computer Architecture & Microprocessor Interfacing

  • 75 % Attendance is Mandatory lecture and 100 % in lab
  • Assignments and quizzes

IT264 Computer Architecture & Microprocessor Interfacing

3

12/20/2024

Teaching Scheme

Theory

Practical

Total

Credit

Hours/week

4

2

6

5

Marks

100

50

150

4 of 44

Reference material

  • Text Book
    • Patterson and Hennessy, Computer Organization and Design: The Hardware/Software Interface, 5th Edition, Morgan Kaufman Publishers, 2014.
  • Reference Books
    • Bryant and O’Hallaron, Computer Systems: A Programmer’s Perspective, Addison Wesley, 2002.
    • Silberschatz, Galvin and Gagne, Operating System Concepts, 8th Edition, John Wiley & Sons, Inc, 2008.
    • Stalling W., Computer Organization & Architecture, 7th Edition, Pearson Education India, 2010
    • Hamacher C. etal, Computer Organization, 5th Edition, McGrawHill, 2002

IT264 Computer Architecture & Microprocessor Interfacing

4

12/20/2024

5 of 44

Course Objectives…

  • How computers work, basic principles?
  • How to analyze their performance (or how not to!)?
  • How computers are designed and built?
  • To understand what happens on a computer system during program execution?
  • Why?
    • In order to improve the quality of the programs that you write
  • Issues affecting modern processors (caches, pipelines, etc.)

IT264 Computer Architecture & Microprocessor Interfacing

5

12/20/2024

6 of 44

Course Motivation…

This knowledge will be useful if you need to

  • Design/build a new computer
    • rare opportunity
  • Design/build a new version of a computer
  • Improve software performance
  • Purchase a computer
  • Provide a solution with an embedded computer

IT264 Computer Architecture & Microprocessor Interfacing

6

12/20/2024

7 of 44

Course Pre requisite…

Require Knowledge of

  • Digital Design Fundamental
  • Data Structure and C/C++ Programming

IT264 Computer Architecture & Microprocessor Interfacing

7

12/20/2024

8 of 44

Outline of the Course…

  • Introduction to Computer Architecture – 4 Hours
  • Instruction Set Architecture – 4 Hours
  • Computer Architecture Space – 3 Hours
  • Performance Measures – 3 Hours
  • Basics of Arithmetic Logic Unit – 8 Hours
  • Processor Design – 6 Hours
  • Pipelined Processor – 5 Hours
  • Memory Hierarchy – 6 Hours
  • Input/ Output Subsystem – 6 Hours

IT264 Computer Architecture & Microprocessor Interfacing

8

12/20/2024

9 of 44

Let’s know about our computer

10 of 44

Tools to discover our computer

IT264 Computer Architecture & Microprocessor Interfacing

10

12/20/2024

11 of 44

Measuring Performance of Computer

  • Benchmark to measure the performance of your processor https://www.geekbench.com/download/

IT264 Computer Architecture & Microprocessor Interfacing

11

12/20/2024

12 of 44

Intel Processors

  • https://www.intel.com/content/www/us/en/processors/processor-numbers.html

IT264 Computer Architecture & Microprocessor Interfacing

12

12/20/2024

13 of 44

Comparing two similar processors

  • https://www.intel.com/content/www/us/en/products/details/processors/core/i7/products.html?wapkw$=$skylake.

IT264 Computer Architecture & Microprocessor Interfacing

13

12/20/2024

14 of 44

Moore’s Law

  • Moore's law refers to an observation made by Intel co-founder Gordon Moore in 1965. He noticed that the number of transistors per square inch on integrated circuits had doubled every two years since their invention. Moore's law predicts that this trend will continue into the foreseeable future.

IT264 Computer Architecture & Microprocessor Interfacing

14

12/20/2024

15 of 44

Time Line: Intel Processor

  • 4004: 4-bit microprocessor – November 1971
  • 8008: 8-bit microprocessor – April 1972
  • 8080: April 1974 – Became standard
  • 8085: March 1976 (3 MHZ)
  • 8086: June 1976
  • 8088: June 1979
  • 80186: March 1980 (10 MHZ)
  • 80286: February 1982
  • 80386: October 1985
  • 80486: April 1991
  • Pentium: March 1993 (60 MHZ)

  • Pentium II: May 1997
  • Pentium III: February 1999 (1.3 GHZ)
  • Pentium IV: January 2001
  • Pentium M: March 2003
  • Core 2 Duo: April 2006 (1.86 GHZ)
  • Core 2 Quad: January 2007 (2.4 GHZ)
  • Core i3 (dual): 2010 (2.93 GHZ)
  • Core i5 (quad): 2010 (3.0 GHZ)
  • Core i7 (quad): 2010
  • Core i7 extreme (Octa): 2012 (4.0 GHZ)

IT264 Computer Architecture & Microprocessor Interfacing

15

12/20/2024

16 of 44

Time Line: Intel Processor

IT264 Computer Architecture & Microprocessor Interfacing

16

12/20/2024

17 of 44

Why is AMD Ryzen 5 3500U better than Intel Core i5-1035G1?

  • 2.1x faster CPU speed
    • 4 x 2.1GHz vs 4 x 1GHz
  • 900 MHz faster GPU clock speed
    • 1200MHz vs 300MHz
  • 0.1 GHz higher turbo clock speed
    • 3.7GHz vs 3.6GHz
  • 0.1 newer version of OpenGL
    • 4.6 vs 4.5
  • 64KB bigger L1 cache
    • 384KB vs 320KB
  • 5°C higher maximum operating temperature
    • 105°C vs 100°C
  • 1 more displays supported
    • 4 vs 3

IT264 Computer Architecture & Microprocessor Interfacing

17

12/20/2024

18 of 44

Why is Intel Core i5-1035G1 better than AMD Ryzen 5 3500U?

  • 1333MHz higher RAM speed?
    • 3733MHz vs 2400MHz
  • 2nm smaller semiconductor size?
    • 10nm vs 12nm
  • 19.87GB/s more memory bandwidth?
    • 55.63GB/s vs 35.76GB/s
  • 32GB larger maximum memory size?
    • 64GB vs 32GB
  • 11.9% higher PassMark result?
    • 7981 vs 7132
  • 19.51% higher PassMark result (single)?
    • 2383 vs 1994
  • 16.67% higher Cinebench R20 (single) result?
    • 420 vs 360
  • 4.18% higher Cinebench R20 (multi) result?
    • 1545 vs 1483

IT264 Computer Architecture & Microprocessor Interfacing

18

12/20/2024

19 of 44

Few Terms…

  • Integrated circuits
  • Central Processor Unit
  • Datapath
  • Control
  • Memory
  • Dynamic Random Access Memory
  • Cache Memory

IT264 Computer Architecture & Microprocessor Interfacing

19

12/20/2024

20 of 44

Software Abstraction…

IT264 Computer Architecture & Microprocessor Interfacing

20

12/20/2024

Computer understand this

Programmer understand this

21 of 44

Comparison of programming languages

IT264 Computer Architecture & Microprocessor Interfacing

21

12/20/2024

0 0010 0000 0000 0100

1 0001 0000 0000 0101

10 0011 0000 0000 0110

11 0111 0000 0000 0001

100 0000 0000 0101 0011

101 1111 1111 1110 1001

110 0000 0000 0000 0000

  • Binary Program to Add Two Numbers

Location Instruction Code

000 2004

001 1005

002 3006

003 7001

004 0053

005 FFE9

006 0000

  • Hexa program

Location Instruction

  • Program with Symbolic OP-Code

000 LDA 004 Load 1st operand into AC

001 ADD 005 Add 2nd operand to AC

002 STA 006 Store sum in location 006

003 HLT Halt computer

004 0053 1st operand

005 FFE9 2nd operand (negative)

006 0000 Store sum here

Location Instruction Comments

  • Assembly-Language Program
  • Fortran Program

INTEGER A, B, C

DATA A,83 / B,-23

C = A + B

END

ORG 0 /Origin of program is location 0

LDA A /Load operand from location A

ADD B /Add operand from location B

STA C /Store sum in location C

HLT /Halt computer

A, DEC 83 /Decimal operand

B, DEC -23 /Decimal operand

C, DEC 0 /Sum stored in location C

END /End of symbolic program

  • C Program

int A=83, B=-23, C

C = A + B

Compiler

Assembler

22 of 44

Steps in gcc.

IT264 Computer Architecture & Microprocessor Interfacing

22

12/20/2024

cpp

hello.c

cc1

as

ld

hello.s

hello.o

a.out

Library files

e.g., math.o, the math library

23 of 44

Linking Multiple Modules

IT264 Computer Architecture & Microprocessor Interfacing

23

12/20/2024

Header Info

Compute(){

call MatMul()

}

Data

Symbol Table

Reloc Info

Header Info

MatMul(){

}

Data

Symbol Table

Reloc Info

24 of 44

Linking Multiple Modules

IT264 Computer Architecture & Microprocessor Interfacing

24

12/20/2024

Header Info

Compute(){ call MatMul

}

Data

Symbol Table

Relocation Info

Combined Header Info

Compute()

MatMul()

Combined

Data

Symbol Table

Reloc Info

Header Info

MatMul(){

}

Data

Symbol Table

Relocation Info

25 of 44

From C Code to Process

IT264 Computer Architecture & Microprocessor Interfacing

25

12/20/2024

  • C source files
    • .c; .h
  • Binary files
    • .o
  • Executables
    • a.out
  • Process
    • Managed by OS

binary files

C source code

process

compiling

running

executable

linking

26 of 44

Memory architecture

  • Continuous memory space for all process
    • each with its physical space
    • pretends you the same virtual space

IT264 Computer Architecture & Microprocessor Interfacing

26

12/20/2024

0xffffffff

0

27 of 44

Organization of Memory: .text

  • Program code and constant
    • binary form
    • loaded libraries

IT264 Computer Architecture & Microprocessor Interfacing

27

12/20/2024

0xffffffff

0

text

28 of 44

Organization of Memory: .text

  • Program code and constant
    • binary form
    • loaded libraries
    • known as text segment
    • space calculated at compile-time

IT264 Computer Architecture & Microprocessor Interfacing

28

12/20/2024

0xffffffff

0

text

29 of 44

Organization of Memory: .data

  • Data: initialized global data in the program
    • Ex: int size = 100;
  • BSS: un-initialized global data in the program
    • Ex: int length;

IT264 Computer Architecture & Microprocessor Interfacing

29

12/20/2024

0xffffffff

0

text

data

bss

30 of 44

Organization of Memory: heap

  • Heap: dynamically-allocated spaces
    • Ex: malloc, free
    • OS knows nothing about it
      • space
      • content
    • dynamically grows as program runs

IT264 Computer Architecture & Microprocessor Interfacing

30

12/20/2024

0xffffffff

0

text

data

bss

heap

31 of 44

Organization of Memory: stack

  • Stack: local variables in functions
    • well discuss stack soon
    • support function call/return and recursive functions
    • grow to low address

IT264 Computer Architecture & Microprocessor Interfacing

31

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

32 of 44

Summary

  • text: program text
  • data: initialized globals & static data
  • bss: un-initialized globals & static data
  • heap: dynamically managed memory
  • stack: function local variables

IT264 Computer Architecture & Microprocessor Interfacing

32

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

33 of 44

Example

char *string = “hello”;

int iSize;

char *f (int x)

{

char *p;

iSize = 8;

p = (char *)malloc (iSize);

return p;

}

IT264 Computer Architecture & Microprocessor Interfacing

33

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

34 of 44

Example

char *string = “hello”;

int iSize;

char *f (int x)

{

char *p;

iSize = 8;

p = (char *)malloc (iSize);

return p;

}

IT264 Computer Architecture & Microprocessor Interfacing

34

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

35 of 44

Variable Lifetime (Scope)

  • text:
    • program startup
    • program finish
  • data, bss:
    • program startup
    • program finish
  • heap:
    • dynamically allocated
    • de-allocated (free)
  • stack:
    • function call
    • function return

IT264 Computer Architecture & Microprocessor Interfacing

35

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

36 of 44

Data Initialization

char *string = “hello”;

int iSize;

char *f (int x)

{

char* p;

iSize = 8;

p = (char *)malloc (iSize);

return p;

}

IT264 Computer Architecture & Microprocessor Interfacing

36

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

program startup

when f() is called

live after allocation; till free() or program finish

37 of 44

Variable Initialization

  • text:
    • readonly
  • data
    • on program startup
  • bss:
    • un-initialized (though some systems initialize with 0)
  • heap:
    • un-initialized
  • stack:
    • un-initialized

IT264 Computer Architecture & Microprocessor Interfacing

37

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

38 of 44

Explicit Memory Management

  • Heap management in C is explicit
    • void *malloc (int bytes);
    • free (void *p);
  • Its the programmers responsibility to make sure that such a sequence of action is safe

IT264 Computer Architecture & Microprocessor Interfacing

38

12/20/2024

39 of 44

Example

int main()

{

int *p;

p = (int *)malloc (sizeof (*p));

*p = 99;

return 0;

}

IT264 Computer Architecture & Microprocessor Interfacing

39

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

p

40 of 44

Example

int main()

{

int *p;

p = (int *)malloc (sizeof (*p));

*p = 99;

return 0;

}

IT264 Computer Architecture & Microprocessor Interfacing

40

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

#@%*&

p

41 of 44

Example

int main()

{

int *p;

p = (int *)malloc (sizeof (*p));

*p = 99;

return 0;

}

IT264 Computer Architecture & Microprocessor Interfacing

41

12/20/2024

0xffffffff

0

text

data

bss

heap

stack

99

p

42 of 44

Architecture & Organization

  • Architecture is those attributes visible to the programmer
    • Instruction set, number of bits used for data representation, I/O mechanisms, addressing techniques.
    • e.g. Is there a multiply instruction?
  • Organization is how features are implemented
    • Control signals, interfaces, memory technology.
    • e.g. Is there a hardware multiply unit or is it done by repeated addition?

IT264 Computer Architecture & Microprocessor Interfacing

42

12/20/2024

43 of 44

Structure of Von Neumann machine

IT264 Computer Architecture & Microprocessor Interfacing

43

12/20/2024

44 of 44

References

  • Which CPU is best? https://www.pcworld.idg.com.au/article/615216/which-processor-best-intel-amd/
  • Understanding the processor: https://www.youtube.com/watch?v=cNN_tTXABUA&ab_channel=InOneLesson
  • Parts of the Computer: https://www.youtube.com/watch?v=ExxFxD4OSZ0&ab_channel=BasicsExplained%2CH3Vtux
  • Hyperthreading: https://www.youtube.com/watch?v=lrT9Bl0MCXQ

IT264 Computer Architecture & Microprocessor Interfacing

44

12/20/2024