Understanding Computers Recall Objective understand computers at machine
Understanding Computers Recall Objective: • understand computers at machine level • interested in software perspective Problem: how can we discuss / explain something that is “unknown” ? One Approach: understand the real machine • how do the millions of transistors in a computer support programs? impractical! (too complex) 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 1
Programmer’s Model Alternate Approach: learn and understand an abstract model of the computer’s behaviour · · emphasize only the important details/attributes have you done this in other courses? programmer’s model abstract model appropriate for explaining software at the machine level · no transistor details! · widely used in industry · models computer as a system System: a set of components that interact to accomplish an objective 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 2
Diagram of a Simple Computer System Processor Bus Memory I/O Computer System § § what are the components? how do they interact? what are the objectives? “A Computer System” Connected Devices keyboard mouse display printer disk drives communication links etc. 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 3
Processor § § § manipulates information located in components: (processor, memory, I/O) by executing instructions information in processor held in registers processor characterized by: • register set: (more later) • instruction set – includes addressing modes (more later) • interrupt mechanism – lets other components notify processor when “events” happen (more in 94. 203!) 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 4
Memory § holds information in cells (or “locations”) § each cell has: • address: a name that identifies cell • contents: the information “value” held in the cell § memory supports two operations: • write(address, value): causes the cell identified by address to replace its contents with value (i. e. new information held in the cell = value) • read(address): returns the value held as the contents of the cell identified by address (contents of the cell are not changed) 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 5
I/O = Input / Output § information exchange between computer and connected devices § independent I/O components associated with each connected device • e. g. keyboard components are associated with the keyboard, mouse components with the mouse, etc. 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 6
Ports · ports exchange information between bus and I/O components · ports are identified by I/O addresses · port operations: read and/or write values (not necessarily both) Note: I/O ports memory cells § control ports: write values to these – control behaviour of component/device § status ports: read values from these – find out about current state of component/device § data port: read and/or write values of these – exchange application information §(More on ports and I/O later!) 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 7
Information Inside Computer Information plays a key role in all components in the computer system How does information exist in a computer system at the machine level? Topic for next few lectures. What sort of information needs encoding? · numbers: counting numbers, integers, reals · other numbers (fractions, complex, etc. ) · characters, strings, text · graphics · days, months, years (Y 2 K bug? ) · others? 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 8
Information Encoding There are hardware limitations · transistors are switched between two states (more in 257 & 267) · on / off or high / low or 0 / 1 information must be encoded in 2 -state values! · one BInary digi. T = one bit = one 2 -state value · possible value of a bit = 0 or 1 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 9
Information Encoding (contd) Further Complication: · registers, cells and ports are built using fixed numbers of transistors · values are encoded in a fixed number of bits! · e. g. value that is 8 -bits wide = byte · finite limitations on range of values! · for n-bit width 2 n different values 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 10
Information Encoding Problem How can information be represented as fixed length binary values ? Information mapping Fixed length binary values finite set! 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 11
Information Encoding Problem (contd) How can information be represented as fixed length binary values? • information is abstract – invented by people • binary values are held in fixed width registers, cells and ports • computers do not “know” about information • computers deal with binary values that have been encoded (by people) to represent information! 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 12
Encoding Example: Days of the Week § suppose an application must deal with day-of-theweek information (e. g. a day-timer/scheduler) § must encode days of the week as binary values § how many bits are needed? § what values should be used? 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 13
Encoding Example (contd. ) One Possible Day-Of-The-Week Encoding: Monday 000 (binary) Tuesday 001 Wednesday 010 Sunday 110 § is the only possible encoding? § would the computer “care” if a different encoding was used? § who would care? 10 -Sep-0194. 201 - Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept. 2001 14
- Slides: 14