The Nature of Computing INEL 4206 Microprocessors Lecture

  • Slides: 31
Download presentation
The Nature of Computing INEL 4206 – Microprocessors Lecture 2 Bienvenido Vélez Ph. D.

The Nature of Computing INEL 4206 – Microprocessors Lecture 2 Bienvenido Vélez Ph. D. School of Engineering University of Puerto Rico - Mayagüez The Nature of Computing INEL 4206 - Microprocessors - Spring 2003

Some Inaccurate (Although Popular) Perceptions of Computing • Computing = (Electronic) Computers • Computing

Some Inaccurate (Although Popular) Perceptions of Computing • Computing = (Electronic) Computers • Computing = Programming • Computing = Software The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 2

Computing = Computers Computing is about solving problems using computers A. K. A. The

Computing = Computers Computing is about solving problems using computers A. K. A. The Computing Device View of Computing The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 3

Computing = Programming Computing is about writing programs for computers A. K. A. The

Computing = Programming Computing is about writing programs for computers A. K. A. The Programming Language view of Computing The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 4

Computing = Software Computing is not concerned with hardware design A. K. A. The

Computing = Software Computing is not concerned with hardware design A. K. A. The “Floppy Disk” view of Computing The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 5

Outline • • What is Computing? Computing Models and Computability Interpretation and Universal Computers

Outline • • What is Computing? Computing Models and Computability Interpretation and Universal Computers Abstraction and Building Blocks The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 6

What is computing then? Input Information Algorithmic Computation Function Output Information Computing is the

What is computing then? Input Information Algorithmic Computation Function Output Information Computing is the study of Computation: the process of transforming information The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 7

The Computation Process encode compute 0110110 0101010 0101… Problem The Nature of Computing decode

The Computation Process encode compute 0110110 0101010 0101… Problem The Nature of Computing decode 0110110 0101010 0101… Solution INEL 4206 - Microprocessors - Spring 2003 8

Fundamental Questions Addressed by the Discipline of Computing • • What is the nature

Fundamental Questions Addressed by the Discipline of Computing • • What is the nature of computation? What can be computed efficiently? How to build practical computing devices? The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 9

Computers as Integer Functions encode compute 0110110 0101010 0101… decode 0110110 0101010 0101… Problem

Computers as Integer Functions encode compute 0110110 0101010 0101… decode 0110110 0101010 0101… Problem Solution Integer The Nature of Computing Integer Function INEL 4206 - Microprocessors - Spring 2003 Integer 10

Computability All Integer Functions (IF) IF ≠ ≟ CF Computable Integer Functions (CF) Halting

Computability All Integer Functions (IF) IF ≠ ≟ CF Computable Integer Functions (CF) Halting Problem The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 11

The Halting Problem (Alan Turing 1936) Given a program P and an input I

The Halting Problem (Alan Turing 1936) Given a program P and an input I to P determine if P stops on I Program P Input I Computer P Halts on I? We cannot build this machine … period The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 12

Computability All Integer Functions (IF) IF ≠ ≟ CF Computable Integer Functions (CF) We

Computability All Integer Functions (IF) IF ≠ ≟ CF Computable Integer Functions (CF) We want to formally describe the set of computable functions. BUT HOW? ? ? The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 Halting Problem 13

Mathematical Computers: The Turing Machine (1936) 0 1 Tape Head Infinite I/O TAPE 0/{0,

Mathematical Computers: The Turing Machine (1936) 0 1 Tape Head Infinite I/O TAPE 0/{0, R} 0 1 FSM 1/{1, L} Alan Turing The Nature of Computing Turing demonstrated how to solve several problems using his LCM computing model INEL 4206 - Microprocessors - Spring 2003 14

Mathematical Computers: The Turing Machine (1936) 0 1 Tape Head Infinite I/O TAPE 0/{0,

Mathematical Computers: The Turing Machine (1936) 0 1 Tape Head Infinite I/O TAPE 0/{0, R} 0 1 FSM 1/{1, L} Alan Turing The Nature of Computing Turing demonstrated how to solve several problems using his LCM computing model INEL 4206 - Microprocessors - Spring 2003 15

A TM Machine Recognizing n n ab Rutgers Turing Machine Example http: //www. rci.

A TM Machine Recognizing n n ab Rutgers Turing Machine Example http: //www. rci. rutgers. edu/~cfs/472_html/TM/anbn. TM. html The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 16

The Halting Problem Proof Sketch (Blackboard) Given a program P and an input I

The Halting Problem Proof Sketch (Blackboard) Given a program P and an input I to P determine if P stops on I Program P Input I Computer P Halts on I? Cannot build this … period The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 17

Ad-hoc Turing Machines We know we can build TM’s to solve many interesting problems.

Ad-hoc Turing Machines We know we can build TM’s to solve many interesting problems. But building a TM is a lot of work FSM FSM Sorting. FSM TM Sorting. TM TM FSM Searching TM FSM Integrating TM Can we build ONE general purpose TM? The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 18

The Universal Turing Machine (UTM) The Paradigm for Modern General Purpose Computers Encoded TM

The Universal Turing Machine (UTM) The Paradigm for Modern General Purpose Computers Encoded TM M Software • just bits • weightless • effective computing models Encoded Tape for M Universal TM Hardware • heavy • expensive • cumbersome computing model • Capable of Emulating Every other TM • Shown computable by Alan Turing (1936) BIG IDEAS: INTERPRETATION & PROGRAMMABILITY!!! The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 19

Other Familiar Models of Computation • • • Combinational Circuits Sequential Circuits (FSM’s) Pentium

Other Familiar Models of Computation • • • Combinational Circuits Sequential Circuits (FSM’s) Pentium Instruction Set Architecture Lambda Calculus Recursive Functions C, C++, Java, C#, etc… Can you tell which ones are Turing Universal, or which ones can emulate any other Turing Machine? The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 20

Church’s Thesis “Any realizable computing device can be simulated by a Turing machine” “All

Church’s Thesis “Any realizable computing device can be simulated by a Turing machine” “All the models of computation yet developed, and all those that may be developed in the future, are equivalent in power. ” Alonso Church Issues not considered: Size, Programmability, Performance But they must be considered if one is to build … The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 21

Practical Universal Computers (John) Von Neumann Architecture (1945) Memory CPU Data. Paths AC Program

Practical Universal Computers (John) Von Neumann Architecture (1945) Memory CPU Data. Paths AC Program This looks just like a TM Tape ALU PC ABR status control Data Control Unit (FSM) CPU is a universal TM An interpreter of some programming language (PL) The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 22

Computing in Perspective Mat. Lab Excel Pascal C++ All have embedded PL’s PSpice Build

Computing in Perspective Mat. Lab Excel Pascal C++ All have embedded PL’s PSpice Build Many Fortran Assembler 1 Multiple Coexisting Levels of Interpretation Assembler 2 ISA FSM Gate CMOS Assembler 3 Build One Programming is the art/science of encoding algorithms The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 23

Computing in Perspective people Computer Human Interaction, User Interfaces Application Programs CS 1/CS 2,

Computing in Perspective people Computer Human Interaction, User Interfaces Application Programs CS 1/CS 2, Programming, Data Structures High-Level Language Programming Languages, Compilers Assembly INEL Language 4206 Computer Architecture Machine Language (ISA) People The Nature of Computing computers Each abstraction layer implements an INTERPRETER of some computing/programming model INEL 4206 - Microprocessors - Spring 2003 24

Why Abstraction Layers? • Resilience to change: – Each layer provides a level of

Why Abstraction Layers? • Resilience to change: – Each layer provides a level of indirection • Divide and Conquer Approach: – Can work on one small semantic gap at a time • Building Block Approach: Because we know of no – Can build many higher layer on same lower layer other way of doing anything The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 25

Hardware Building Blocks A B A O SEL B sel O A 2 -1

Hardware Building Blocks A B A O SEL B sel O A 2 -1 multiplexer Gate-Level Logic Provides a Computing Model The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 26

Software Building Blocks The function is one of the most ubiquitous abstraction tools //

Software Building Blocks The function is one of the most ubiquitous abstraction tools // MUX – Implements a bool MUX(bool a, bool switch(sel) { case 0: return a; case 1: return b; } } 2 -1 binary multiplexer b, bool sel) { break; Other abstraction tools include: structures, classes, modules The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 27

What Makes a Good Building Block • • Provides a clear and simple contract

What Makes a Good Building Block • • Provides a clear and simple contract The contract hides irrelevant detail The contract is general and orthogonal The contract is easy to remember The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 28

Some Properties of a Good Programming Language • • Does not hide expressive power

Some Properties of a Good Programming Language • • Does not hide expressive power of lower layers Can be efficiently interpreted Provides adequate higher level abstractions Provides a variety of constructs for creating new abstractions, layers and modules • Achieves all of the above with minimal complexity The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 29

Summary • • Computing = Information Transformation = Integer Functions Some integer functions are

Summary • • Computing = Information Transformation = Integer Functions Some integer functions are not computable Turing Machine computations = All computations Universal Computer = Universal TM Interpretation => Programmability => Flexibility Building blocks are abstract contracts The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 30

Summary "Computer Science is no more about computers than Astronomy is about telescopes" E.

Summary "Computer Science is no more about computers than Astronomy is about telescopes" E. W. Dijkstra 1930 -2002 1972 Turing Award The Nature of Computing INEL 4206 - Microprocessors - Spring 2003 31