Advertisement
Guest User

51 Midterm

a guest
Oct 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.58 KB | None | 0 0
  1. Computer Operation:
  2.  
  3. - Computers only understand machine level instructions that are simple and low level
  4. - this languages simplifies the process of hardware design
  5. - however, its still hard to write complex programs this way in machine language, so we prefer to use higher-level languages instead
  6.  
  7.  
  8. How can we execute these high level languages (L1) on standard hardware?
  9. - We can make use of compilers and interpreters to either
  10. translate: replace whole blocks of code or entire programs with their machine language (L0) equivalent
  11. interpret: taking each instruction from the high level language and execute it one at a time
  12.  
  13. - Translation is slower, but easier to debug. Interpreting is faster and more efficient
  14. - We can thus think of compilers or interpreters as virtual machines for L1, because as far as us users are concerned the L1 is executed
  15.  
  16. Hierarchy of VMs:
  17.  
  18. - The L1 and L0 cant be too different, but we can have a hierarchy of virtual machines that do the job of breaking down the language into its relevant complexities at its level, thereby hiding the details of the level below it
  19. - Virtualization is thus achieved, and gives us a layered or structured way of looking at computers
  20.  
  21. Layered or Structured View:
  22.  
  23. - Layers move from the top down, in decreasing order of abstraction. Each layer groups together similar elements and abstracts away details of whats below. This way, the understanding of the system is simplified and complexity of the system is hidden.
  24. - In our theoretical model, the bottom layer belongs to hardware, transistors, etc. - but in practice and reality there are layers below it as well.
  25.  
  26.  
  27. Hardware has influence in the definition of many basic issues:
  28.  
  29. - digital hardware has 2 states to incorporate the functionality of binary arithmetic
  30. - The speed of computer memory is dependent on its physical type and size
  31. These details are abstracted away from a programmer making use of the level meant for the high level language, but hardware is an important component to computer functionality
  32.  
  33.  
  34. The Layered or Structured View Model follows:
  35.  
  36. - The Application Program Layer:
  37. High level languages (L1) are written in this language to solve a problem and incorporate heavy abstraction in terms of the way physical features of the computer are interacted with as simple variable names, or control structures, objects, etc. The high level languages written in this layer need are translated to the language of a lower layer to be directly executed by the hardware. They also make use of function libraries supplied by the compilers or OS.
  38.  
  39. - Assembly Language Layer:
  40. Abstractions are to a lower level in this extent, but there is more direct interaction with the hardware and more details of the hardware are exposed for this level to make use of. The language written in this layer views the computer as an Instructions Set Architecture, and also has access to OS-level abstractions
  41.  
  42. - OS Layer
  43. This layer has the ability to implement multiprogramming. It also gives users privilege in their execution of hardware details and resources. It also provides protection to the system from the user and to the user from other users. This layer also provides several abstractions to the user in terms of the way its features can be used and how they are actually handled in the background (e.g) virtual memory.
  44. access to the functions in the OS is through the system call interface
  45.  
  46. - Instructions Set Architecture Layer:
  47. ISA is the assembly programmer's view of a computer. The abstractions it provides are in terms of its data types, instructions, memory addressing, addressing modes and registers.
  48.  
  49. - Microarchitecture Layer:
  50. This layer primary deals with the organization of a computer, in that it describes major units of a system(ALU, etc.), how they are interconnected and protocols for their communication. This layer then abstracts the digital logic and hardware layer
  51.  
  52. - Digital Logic Layer:
  53. This layer details the gate level functioning of a computer and shows the gate-level implementation. Gates are basic building blocks at this level, but it still abstracts away further details about transistors like their analogous nature, which we ignore and only treat them as digital switches that are either ON or OFF
  54.  
  55. - Hardware Layer:
  56. Describes a computer at a transistor level. These transistors are abundant in modern processors, and are integral to the design of the system. Still, even they need their own abstraction to make the design of processors possible through the grouping of the constructor of semiconductors and transistors, and gates and memory cells.
  57.  
  58.  
  59. System Organization Terminology:
  60.  
  61. CPU: Central Processing Unit. Same as processor. Consists of data path and control unit.
  62. Data path: ALU plus register file
  63. Memory: DRAMs plus controller. Always byte-addressable
  64. Bus: A collection of wires and protocol for communication.
  65.  
  66. - I/O devices are viewed as memory. You read/write data to/from them
  67.  
  68.  
  69. System and CPU Organization:
  70.  
  71. Within the CPU is the ALU, Registers, and Control unit. This CPU box is connected to a bus that externally runs along and branches into connections with main memory, the disk and a printer
  72.  
  73.  
  74. CPU Instruction Execution Cycle:
  75.  
  76. - Fetch instruction from memory and load into Instruction Register (IR)
  77. - Increment Program Counter (PC)
  78. - Decode Instruction in IR
  79. - Fetch and additional operands specified by fields in IR
  80. - Execute the instruction specified by the IR
  81. - Store result (if necessary) as specified by a field in IR
  82.  
  83. The above loop is done forever until a HALT instruction stops the processor. This is the main algorithm for the control unit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement