390 likes | 513 Views
COSMOS Summer 2008 Embedded Systems. Rajesh K. Gupta Computer Science and Engineering University of California, San Diego. Roadmap. Topic: What are embedded systems? What has that got to do with computers and ‘chips’? This lecture
E N D
COSMOS Summer 2008Embedded Systems Rajesh K. Gupta Computer Science and Engineering University of California, San Diego. 2008 R. Gupta, UCSD
Roadmap • Topic: • What are embedded systems? • What has that got to do with computers and ‘chips’? • This lecture • Concepts covered: computing, computers, computer architecture • Computer peripherals • Next lecture • Computer interfaces and networks: I2C, SPI • Reference • None Keywords: Embedded Computer Computing Machines Computer Application Computer Architecture Computer Organization CPU, Memory, Bus ISA 2008 R. Gupta, UCSD
Conventions (if I can follow them • Important concept words are usually highlighted • Or strongly highlighted. • “Memory” means more than it says • Challenges and Teasers • Teaser questions are not meant to be answered 2008 R. Gupta, UCSD
"Embedded Everywhere" 2008 R. Gupta, UCSD
Embedded Systems • “Systems” that are part of another “Application” • We are interested in “Embedded Computer Systems” • Why? Hold that thought for now. (Hint: wait until ‘chips’) • Computers are machines that are designed either for general-purpose applications or for specific applications. • Computing refers to problem solving using Computers • machine-centric problem solving. • In the past, computing are confined to scientific applications, and machines were expensive and necessarily shared. 2008 R. Gupta, UCSD
Examples of Computational Problem Solving • Can you think of examples where you need computers to solve problems? • Day-to-day • In-the-interest-science-and-humanity • Actually by far the largest application of computing was in building computers (hw, sw) 2008 R. Gupta, UCSD
Problem Solving • Problem: • Find greatest common divisor of two numbers: 6, 15. • Solutions: 1. Mathematical: gcd(a, b) = gcd(a-b, b) assumew.l.o.g. a >=b gcd(a, 0) = a 2. Procedural (Sequential): Chinese Remainder Theorem. if (x != 0 and y!= 0) { repeat { while (x>=y) x = x - y; swap x, y; } until (y=0); write gcd = x; 2008 R. Gupta, UCSD
Traditional Problem Solving using Computers • Describe the method in a programming language • Compile this program into a machine language • Execute machine program • supply input data 2008 R. Gupta, UCSD
The Computing Experience • The Computer Center • Mainframe computing • The Personal Computer • Desktop, laptop, palm top computing • The Ubiquitous Embedded Computer • Mobile, purpose-built. 2008 R. Gupta, UCSD
Computing Machines: Touchpoints in History • Generation 0: Mechanical machines • Difference engine by Babbage (1834) • Generation 1: Vacuum Tubes (1945-1955) • ENIAC by Eckert and Mauchly (1943) • Generation 2: Transistors (1955-1965) • PDP-1 by DEC (1960): first microcomputer • Generation 3: Integrated Circuits (1965-1980) • IBM 1401, 7094 and System/360 (1964) • Generation 4: PCs and VLSI (1980-continuing) 2008 R. Gupta, UCSD
The Computer • Computers manipulate information by means of programmed instructions • A computer hardware that makes this possible is called a stored program computer. • A computer system designer must • evaluate applications for which the computer is to be used • build a system architecture from software to its hardware organization • (by architecture we often mean how the system appears to the system programmer, though it is not strictly correct..) • The lexicon: architecture, organization, usage. 2008 R. Gupta, UCSD
Computer Architecture • Architecture provides • A model to organize, implement system parts • A model to use the system • Architectures can be diverse… 2008 R. Gupta, UCSD
The Planned Community “Organically grown” The sacrificial altar Engineered Specialized Ambitious (and never finished) Architectural Design Paradigms
CPU Memory Address Controller DataPath control enables selects R/W Data data conditions Hardware Organization • Computer Organization refers to the structure of a computer: 2008 R. Gupta, UCSD
Application Compiler Assembler Micro-operations Hardware Software ‘Architecture’ 2008 R. Gupta, UCSD
A Personal Computer (PC) • Uses commodity components and standard interfaces to build the machine • Performance/cost variations due to choice of components and (sometimes) their interconnection. 2008 R. Gupta, UCSD
PC Components • Case: • desktop, minitower, mid case, mid tower, full tower, large tower • include a power supply (typically 200 watts) • CPU and CPU fan • sold as a chip • Motherboard • single-board computer • contains place holders for CPU and Memories • Memory modules • Interfaces • Video (card and monitor) • Others: (I/O card) “Floppy, CD-ROM, Keyboard, Hard drive, Sound card, Speakers, Modem, Tape/zip drive, Mouse” 2008 R. Gupta, UCSD
168-pin SDRAM The Stuff at Fry’s 184-pin DDR-SDRAM 2008 R. Gupta, UCSD
CPU MEM BUS Personal Computing • “Low cost and general purpose” CPU DATA INST BUS 2008 R. Gupta, UCSD
CPU MEM BUS Devices Devices Devices Computer Organization 1 3 2 4 Drives Input devices Output devices Networking Interface 2008 R. Gupta, UCSD
CPU MEM BUS Devices Devices Devices Memory 2-3 GHz 50 ns SIMM PC2-5300 667 MHz DIMM 2008 R. Gupta, UCSD
CPU Cache Memory Lexicon: Non-intuitive & Not-obvious • Random Access: RAMs • static • dynamic • quasi-static • Read Only: ROMs • PROM • EPROM • EEPROM • Flash EPROM • “CMOS” • “Cache”? What are L1, L2, L3? 2008 R. Gupta, UCSD
Buses • Functions: • transmit information • coordinate activities • interface standard • Bandwidth, width/xfr * xfr/sec • Memory addressing, addr/word, addr/block • Latency tolerance: low, medium, high • Length: microns, mm, inches, feet, km, 1000s km 2008 R. Gupta, UCSD
Buses • Network -- Main Memory • similar to disk-memory • Memory/CPU -- Display • high bandwidth, 1-20 MB/sec • Computer -- Computer • medium bandwidth, kbps to Mbps, addr/message. • CPU -- L1 Cache • very high bandwidth, 50-500 MB/sec, addr/word • L1 Cache -- L2 Cache • Cache -- Main Memory • very high bandwidth, 1-200 MB/sec • Main Memory -- Disk • high bandwidth, 2 MB/sec, addr/block 2008 R. Gupta, UCSD
Controller DataPath control enables selects data conditions select CPU – Memory Interaction Clock 200 ns CPU Memory Address clock R/W addr VALID Data 500 ns • CPU controlled by a clock pulse. • Memory is controlled by R/W control signals. • CPU must synchronize its memory read, write operations with respect to its internal clock. • Example: 5 MHz clock, 500 ns access time. R/W’ data VALID WRITE CYCLE 2008 R. Gupta, UCSD
CPU Operation • A computing machine delivers its functionality using instructions. • instruction set architecture (ISA) • A CPU executes each instruction in steps: • Fetch instruction • Decode instruction • Execute instruction • Fetch instruction • location pointed by the Program Counter 2008 R. Gupta, UCSD
CPU Simplified Register File A B ALU Accumulator 2008 R. Gupta, UCSD
The Assembly Language • Machine defined by an ISA • A programis translated into an object program • An assembly language consists of • statement corresponding to machine instructions • represented mnemonically: easier to remember than numbers and bits • typical mnemonics: ADD, SUB, MUL • machine dependent 2008 R. Gupta, UCSD
Controller Data Path control enables selects data CPU data conditions prog. MEM A B SR mux SA ALU Register File Lc C A B ALU Accumulator Program Level 3 Level 2 Level 1 Level 0 Hardware View Software View 2008 R. Gupta, UCSD
Mem PC Let us see how a programmer would build a CPU... Step 1: PC points to an instruction in the memory. 2008 R. Gupta, UCSD
Mem PC Mem PC IR Let us see how a programmer would build a CPU... Step 2: Memory responds with “data” that represent an instruction to be stored in IR. Step 1: PC points to an instruction in the memory. 2008 R. Gupta, UCSD
Mem PC Mem PC IR Mem PC IR Let us see how a programmer would build a CPU... Step 2: Memory responds with “data” that represent an instruction to be storedin IR. Step 1: PC points to an instruction in the memory. control Step 3: an instruction is decoded into “control” lines by the control block. 2008 R. Gupta, UCSD
Mem PC Mem PC IR Mem PC IR Let us see how a programmer would build a CPU... Step 2: Memory responds with “data” that represent an instruction to be storedin IR. Step 1: PC points to an instruction in the memory. Mem PC ALU IR control control Acc Step 3: an instruction is decoded into “control” lines by the control block. Step 4: Memory also provides “data” that is used by the ALU to compute variable values. 2008 R. Gupta, UCSD
Mem PC ALU IR control save data into memory. Acc CPU Building (contd.) load new address into PC, jump operation. addr data out data in Step 5: ALU output is stored back into memory; the ALU may also compute address, in which case ACC output it input to PC. ALU also computes data which is stored in memory. 2008 R. Gupta, UCSD
Instrumented wide-area spaces Internetend-points In-body, in-cell, in-vitro spaces Personal area spaces The Changing Computer 2008 R. Gupta, UCSD
Graphics Controller Cellphone Baseband Driven By “Chips” Underneath 2008 R. Gupta, UCSD
Embedded Systems: Sensor Node 2008 R. Gupta, UCSD
Recap • A computer is a ‘Computing Machine’ • We saw what a computer looks like • Beyond what you see at Fry’s • Architectural components & interfaces • CPU, ALU, Memory, Bus • Application = What can we do with computers • Traditional numeric problem solving replaced by ‘special-purpose’ functions • Sensing, control, media,… • Next: what are peripherals and how we connect to these? 2008 R. Gupta, UCSD