1 / 42

CSE 5311 Fundamentals of Computer Science

CSE 5311 Fundamentals of Computer Science. Computer System Overview. Computer Systems. Computer systems have two major aspects - hardware and software. Hardware - The parts of the computer you can actually see and touch.

lamont
Download Presentation

CSE 5311 Fundamentals of Computer Science

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 5311Fundamentals of Computer Science Computer System Overview

  2. Computer Systems • Computer systems have two major aspects - hardware and software. • Hardware - The parts of the computer you can actually see and touch. • The hardware (in a programmable computer) is directed by the software to carry out tasks. • Software - Instructions and data stored in memory (a type of hardware) in the form of magnetic or electrical impressions. • The instructions are used to control the hardware.

  3. Hardware • Hardware can be divided into three groups: • Processing • Central Processing Unit (CPU) • Arithmetic Logic Unit (ALU) • Control Unit (CU) • Floating-Point Unit (FU) • Memory Manager (MM) • Direct Memory Access (DMA) controller • Various other device controllers. • Input/Output Devices • Keyboard • Mouse • CRT • Printer • Disk Drive

  4. Hardware • Hardware can be divided into three groups (continued): • Memory • Random Access Memory (RAM) • Read Only Memory (ROM) • Disks • Floppy • Hard • CD • DVD • Tape • Registers • Cache (associative memory)

  5. Computer-System Architecture

  6. Memory

  7. REGISTERS Memory volatile CACHE • Memory can be viewed in a hierarchical structure: RAM non-volatile DISKS

  8. Memory • A program must exist in memory in order to execute. • When a program is executed, it begins a process of migration from disk memory to RAM, cache, and register memory. • Depending on a programs size, as it executes parts of it may move back and forth between disk memory and register memory many times. • The operating system is chiefly responsible for data migration.

  9. 32-Bit Intel Register Set There is also a set of floating point registers

  10. Disk Surface Physical Organization • Every disk is organized into tracks, which in turn are divided into sectors • Within a sector the bit is the smallest data unit • Sectors are logically grouped by the OS into clusters

  11. Logical Disk Organization Every formatted disk contains one boot record, a root directory, and two file allocation tables. The remainder of the disk space is “data area”

  12. Physical Organization of Hard Drive Each disk surface has a head which is fixed to the end of an access arm. All arms and heads are moved simultaneously by a single actuator.

  13. Disk Drive Actuators The actuators is responsible for the movement of the read/write heads.

  14. Physical Organization of Disks • On hard drives the read/write “floats” above the disk surface. Disk constantly rotates. • On floppy drives the read/write head touches the disk surface. Disk only rotates when a read or write is in process.

  15. Software • Software can be divided into two groups: • Systems programs • Operating system • Program translators • assemblers • compilers • interpreters • Linkers • Loaders • Device drivers (may be considered as part of the OS) • Note: Some persons consider operating systems to be the only true system program. Everything else is considered an application program.

  16. Software • Software can be divided into two groups: • Application programs • payroll programs • games • spreadsheets • tax preparation software • text editors

  17. Operating Systems • The job of the operating system is to manage system resources by maximizing the throughput of the computer system. • This is accomplished by keeping all hardware resources as fully occupied as possible. • The operating system provides a buffer between human users and the hardware and other programs and the hardware. User OS HW Programs

  18. OS in Relation to Other System Components

  19. Program TranslatorsCompilersAssemblersInterpreters

  20. Lexical Analysis Parsing Code Generation The Translation Process source program object program All translators follow this general process. However, for high-level languages the process is much more complex than for low-level languages.

  21. Compilers • Compilers convert programs written in a high-level language into machine language. • Machine language is used to communicate with the CPU. • Examples of high-level languages that depend on compilers: C, C++, PL/I, COBOL, FORTRAN, Pascal. • High-level languages have a one-to-many translation ratio. • One high-level instruction is translated by the compiler into one or more machine instructions. Mov b to register ax Compiler a = b + c; Add c to register ax Mov register ax to a

  22. Compiler Object File The Compilation and Linking Process Object Library Linker High-level Source Code Object Library Executable File

  23. Compilers • All programming languages must be formally defined. • A language’s formal definition is known as its grammar. • The grammar is used to indicate is a sequence of source code symbols (tokens) are syntactically correct. • There are different notations available for writing grammars • The parser is the part of the compiler that, based on the grammar, determines if the program is syntactically correct.

  24. Compilers • Grammar for a simplified version of Pascal expressed using Backus-Naur Form (BNF) notation. • Upper-case tokens represent reserve words. • ‘id’ represents identifiers • ‘int’ represents an integer constant

  25. Compilers • Pascal program that conforms to the proceeding grammar.

  26. Compilers • Lexical analysis is the process of breaking the source code into tokens • Tokens may optionally be assigned a numeric code • The scanner is the part of the compiler that performs lexical analysis • Tokens requested by the parser one at a time

  27. assign ::= id := <exp> Compilers • Recursive-descent parse of an assignment statement • TOKEN represents the most recent token returned by the scanner • ‘advance to next token’ represents a call to the scanner to provide the next token in the source file input stream

  28. Compilers • Recursive-descent parse of an expression statement exp ::= <term> { + <term> | - <term> }

  29. Assemblers • Assemblers convert programs written in a low-level language into machine language. • Examples of low-level languages that depend on assemblers: Intel 8086-based assembler, Motorola 6800-based assembler, IBM System 360/70 assembler. • Low-level languages have a one-to-one translation ratio. • One assembly instruction is translated by the assembler into one machine instruction. mov ax,b Mov b to register ax Assembler add ax,c Add c to register ax mov a,ax Mov register ax to a

  30. Machine Code • Object files and executable files are mostly composed of machine instructions. Compilers and Assemblers produce machine code; Interpreters produce p-code (byte code). • The first byte of a machine instruction is known as the opcode. The opcode indicates what type of operation (add, subtract, etc.) the instruction is to carry out. • The length of the machine instruction varies according to the number of operands and addressing modes used. Intel Instruction Format (8086/8088)

  31. Assembler Object File The Assembly and Linking Process Object Library Linker Low-level Source Code Object Library Executable File

  32. Interpreters • Interpreters “execute” programs written in a high-level language without converting it into machine language. • Examples of languages that depend on interpreters: Quick BASIC, Java, Lisp, Smalltalk, Visual Basic. • Interpreters do not product object files containing machine code, but sometimes produce pseudo code. • Interpreters allow for features such as automatic garbage collection Assign (temp, Add (b,c)) Interpreter a = b + c; Assign (a, temp)

  33. Interpreters p-code software interpreter operating system • The interpreter provides a virtual run-time environment • A Java interpreter is called a “virtual machine” hardware

  34. Interpreter (translation mode) P-code File The Interpretation Process P-code Library Interpreter (execution mode) High-level Source Code P-code Library

  35. Basic Hardware Architecture

  36. Computer-System Architecture

  37. Basic Architectural Components • The central processor communicates with main memory and I/O devices via buses • Data bus for transferring data • Address bus for the address of a memory location or an I/O port • Control bus for control signals (Interrupt request, memory read/write …) • Each operation must be synchronized by the system clock • Registers are high-speed storage within the processor

  38. Simplified CPU Design

  39. Central Processing Unit • Typically a general purpose CPU will contain: • Arithmetic Logic Unit • Floating Point Unit • Similar to ALU but works with floats • Register File • Contains all registers (not a true file) • Memory Management Unit • Performs logical to physical address translation • Control Unit • Tells the ALU and FPU which operations to carry out.

  40. The Fetch-Decode-Execute Cycle • Is the basic cycle for instruction execution • Fetch the next instruction • place it in queue • update program counter register • Decode the instruction • perform address translation • fetch operands from memory • Execute the instruction • store result in memory or registers • set status flags according to result • Before fetching next instruction, the CPU checks if an interrupt is pending (more on that later)

  41. Microcode • The circuits in most general-purpose processors (Intel, Motorola, IBM) are directly controlled by software known as microcode (aka firmware). • Microcode resides in a type of read-only memory known as control memory. • When a machine instruction is fetched from RAM by the processor to be executed, the machine instruction’s op code serves as an address of a micro- coded subroutine in control memory that “executes” the machine instruction.

  42. Simplification of a Micro Code-Driven Architecture • The Function Unit is the same as the ALU • Memory M is RAM and ROM

More Related