CS 233 Lecture Notes - Fall 2024 PDF

Summary

These lecture notes provide an introduction to computer architecture, covering topics such as hardware components, software types, and stages of development. The notes describe the roles of high-level programming languages, assemblers, binary language, and more.

Full Transcript

Introduction and Below your Program Dr. Nermin Negied Dr. Mai Hassan Agenda Organization and Hardware Understanding Program Performance Software High-Level Language and Hardware Language Stages of Development Benefits of High-level programming languages U...

Introduction and Below your Program Dr. Nermin Negied Dr. Mai Hassan Agenda Organization and Hardware Understanding Program Performance Software High-Level Language and Hardware Language Stages of Development Benefits of High-level programming languages Under the covers Technologies for building processor and memory Organization and Hardware Organization and Hardware The implementation of a computer has two components: Hardware Organization Hardware Hardware refers to the specifics of a computer including: Detailed logic design and Packaging technology of the computer Organization The term organization includes the high-level aspects of a computer’s design, such as: The design of the internal processor or central processing unit (CPU) CPU is where arithmetic, logic, branching, and data transfer are implemented The memory system The memory interconnections (bus structures) Design issues Architecture covers all three aspects of Computer architects must design a computer to computer design: meet: 1. Instruction set architecture 1. Functional requirements 2. Organization 2. Cost goals (price) 3. Performance goals 3. Hardware 4. Availability goals Understanding Program Performance Understanding Program Performance Hardware or software component How this component affects performance Determines both the number of source-level statements and Algorithm the number of I/O operations executed Programming Language, Compiler, Determines the number of computer instructions for each and architecture source-level statement I/O system (Hardware and Determines how fast I/O operations may be executed operating system) Software Software The purpose of Software is: To convert instructions and data into information There are two different kinds of Software: System Software Application Software System Software Enables application software to interact with the computer hardware and background software which helps manage resources Collection of programs Operating System Utilities Device Drivers Compilers Assemblers System Software Operating system is essential as it: Coordinates computer resources Provides the user interface Runs applications Application software Application software is end-user software There are three types of application software: General-Purpose applications Specialized applications Mobile apps High-Level Language and Hardware Language From High-Level Language to Hardware Language To speak to electronic The easiest signals for computers to hardware, understand are ON and OFF you need to send electrical SO, the computer alphabet is just two signals letters. Binary language Two symbols for these two letters are the numbers 0 and 1 Computer language are numbers in base 2, or binary numbers We refer to each “letter” as a binary digit or bit Computers are slaves to our commands which are called instructions Instructions are collections of bits which Computer understands and obeys Can be thought of as numbers Important definitions Binary digit (bit): One of the two numbers in base 2 (0 or 1) that are the components of information Instruction: A command that computer hardware understands and obeys Using numbers for both instructions and data is a foundation of computing Stages of Development Stages of Development The first programmers communicated to computers in binary numbers BUT it was tedious that they quickly invented new notations that were closer to the way humans think At first, these notations were translated to binary by hand, but this process was still tiresome Using the computer to help, the pioneers invented programs to translate from symbolic notation to binary. The first of these programs was named an assembler. Stages of Development Assembler: translates a symbolic version of an instruction into the binary version For example: The programmer would write add A, B The assembler would translate this notation into 1000110010100000 This instruction tells the computer to add the two numbers A and B The name of this symbolic language, is assembly language The binary language that the machine understands is called machine language Important Definitions Assembly language: A symbolic representation of machine instructions Machine language: A binary representation of machine instructions Assembly language requires the programmer to write one line for every instruction that the computer will follow Forcing the programmer to think like the computer. (Is that good?) Stages of Development The recognition that a program could be written to Translate a more powerful language into computer instructions was one of the great breakthroughs in the early days of computing Programmers today owe their productivity to: The creation of high-level programming languages Compilers that translate programs in such languages into instructions Important definitions High-level programming language: A portable language such as C, C++, Java, Python or Visual Basic Composed of words and algebraic notation That can be translated by a compiler into assembly language Stages of Development Binary High-Level Machine Language Language Program Program (in C) (for MIPS) Assembly Language Compiler Assembler Program (for MIPS) Benefits of High-level programming languages Benefits of High-level languages They allow the programmer to think in a more natural language Using English words and algebraic notation Resulting in programs that look much more like text than tables of mysterious symbols Moreover, they allow languages to be designed according to their intended use Fortran was designed for scientific computation Cobol for business data processing Lisp for symbol manipulation, and so on Benefits of high-level languages They improved programmer productivity It takes less time to develop programs when they are written in languages that require fewer lines to express an idea High-level programming languages allow programs to be independent of the computer on which they were developed Since compilers and assemblers can translate high-level language programs to the binary instructions of any computer These advantages are so strong, today little programming is done in assembly language Under the Covers Under the Covers Let’s open the covers of your computer to learn about the underlying hardware The underlying hardware in any computer performs the same basic functions: 1. Inputting data 2. Outputting data 3. Processing data and 4. Storing data The five classic components of a computer The organization of a computer, shows five classic components: Input: writes data to memory Output: reads data from memory Memory: where the data is stored Datapath Control: sends signals to determine operations of Datapath, memory, input, and output Datapath, and Control are sometimes combined and called processor The processor gets instructions and data from memory Central Processing Unit (CPU) The central processing unit consists of six main components: Control unit (CU) Arithmetic logic unit (ALU) Registers Memory Unit Buses Clock Central Processing Unit (CPU) Control unit The CU provides several functions: it fetches, decodes, and executes instructions it issues control signals that control hardware it moves data around the system Arithmetic logic unit The ALU has two main functions: It performs arithmetic and logical operations (decisions). The ALU is where calculations are done and where decisions are made. It acts as a gateway between primary memory and secondary storage. Data transferred between them passes through the ALU. Central Processing Unit (CPU) Registers Registers are small amounts of high-speed memory contained within the CPU. They are used by the processor to store small amounts of data that are needed during processing, such as: Address of the next instruction to be executed Current instruction being decoded Results of calculations Different processors have different numbers of registers for different purposes, but most have some, or all, of the following: program counter memory address register (MAR) memory data register (MDR) current instruction register (CIR) accumulator (ACC) Central Processing Unit (CPU) Memory Unit (Cache) The cache is a small amount of high-speed random access memory (RAM) built directly within the processor. It is used to temporarily hold data and instructions that the processor is likely to reuse. This allows for faster processing as the processor does not have to wait for the data and instructions to be fetched from the RAM. Buses A bus is a high-speed internal connection. Buses are used to send control signals and data between the processor and other components. Three bus types are used: Address bus, Data bus, and Control bus Clock The CPU contains a clock that is used to coordinate all of the computer’s components. The clock sends out a regular electrical pulse which synchronizes (keeps in time) all the components. Technologies for building processor and memory Processor and Memory Technologies Vacuum tube: An electronic component, predecessor of the transistor Consists of a hollow glass tube about 5 to 10 cm long from which as much air has been removed as possible Uses an electron beam to transfer data Transistor: An on/off switch controlled by an electric signal Very large-scale integrated (VLSI) circuit: A device containing hundreds of thousands to millions of transistors Thank you Lecture 1 Dr. Nermin Negied Dr. Nermin Negied

Use Quizgecko on...
Browser
Browser