Download presentation
Presentation is loading. Please wait.
Published byCharla Long Modified over 8 years ago
1
Lecture 01: Computer Architecture overview
2
Our Goals ● Have a better understanding of computer architecture – Write better (more efficient) programs – Better understand high-level concepts (e.g. in Python, MathPiper, …) ● Understand the compile process ● Give us a framework to discuss C/C++ concepts. ● Remove some of the “magic” from programming.
3
What we won't cover (here) ● Specific architectures – X86 – ARM – … ● Specific OS's (Windows, Linux, OSX,...)
4
The major computer components ● CPU – Registers – ALU – Cache ● RAM (Random Access Memory) ● Storage Devices (Hard Disks, DVD, Flash, …) ● Operating System ● Other I/O Devices – Network – USB –…–… ● GPU (Graphics Processing Unit) ● External Devices (Mouse, Keyboard, Monitor, …)
5
RAM ● Q: What does it do? ● A: Stores numbers (and only numbers) – 4 GB (GigaBytes) ● ≈4 billion bytes ● For now, a byte can store a single (smallish) number
6
RAM, cont. ● Anything currently being used by the computers must be in RAM. – Images being edited in photoshop – A text message being composed – A 3D model – A musical composition – … ● Q: So how do we store these “real-life” things in RAM (since it only holds numbers)? ● A: We have to encode it as a sequence of numbers
7
RAM, cont. ● Encoding text – A table. One glyph = one number – Everyone has to agree on this table ● e.g. sending a text message from iPhone to Android – This won't work if they don't agree on the encoding – Some choices: ● Unicode ● EBCDIC ● ASCII
8
RAM, cont (ASCII table) From http://people.revoledu.com/kardi/resources/Converter/ASCII-table.htmlhttp://people.revoledu.com/kardi/resources/Converter/ASCII-table.html
9
CPU ● Q: What does it do? ● A: Several variants of: – Simple math (add, sub, div, mul) – Compare 2 numbers (is-equal?, is-less-than, …) – Change which instruction we do next (jump) – Read / Write from / to RAM and/or registers – Send a signal to a device (hardware interrupt) http://en.wikipedia.org/wiki/Central_processing_unit
10
CPU, cont. ● It does it fast – ex. 2 GHz machine ● Hz is a frequency (units are 1 / sec) ● Giga ≈ 1 billion – Mega ≈ 1 million – Kilo ≈ 1 thousand ● ≈2 billion operations per second ● Note: no “magic”
11
CPU, cont. (registers) ● Very high-speed memory ● Used while doing CPU operations ● Our fictional registers (modeled after 16-bit x86) – AX, BX, CX, DX: general purpose – FLAGS: store various states – IP: Holds address of next instruction to execute – SP and BP: for accessing stack memory – SI and DI: for accessing array elements – [We'll explain these and illustrate their use later]
12
CPU, cont. (Cache) ● A small bit of high-speed memory (~8MB on Intel i7) – The CPU is much faster than RAM access times (which is faster than HDD access) – Holds recently used values from RAM – Values are periodically synced. ● We (programmers) don't typically need to worry about cache – it just works. http://computer.howstuffworks.com/computer-memory1.htm Faster, More expensive (less of it)
13
Operating System ● A part of all general purpose devices – Not necessarily embedded devices ● Usually includes – A GUI front-end – A consistent interface to hardware devices ● Device drivers ● Resource management (files, network connections, memory) ● I/O routines (keyboard, mouse, files,...) – Support for multiple threads – Security support – …
14
Hard Disks ● Long-term storage (i.e. no power needed to store) ● Stores: – Operating System(s) ● Virtual memory – Programs – Documents ● Images ● Text ● 3D Models ● … http://www.123rf.com/photo_10847649_hard-disk.html
15
Other devices ● GPU, Network, sound, … ● From a programmer's point of view: – Use OS to interact with them ● We'll (hopefully) experiment with these near the end of the course.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.