Traditional IBM Mainframe Operating Principles
|
|
|
- Clemence Shields
- 9 years ago
- Views:
Transcription
1 C H A P T E R 1 7 Traditional IBM Mainframe Operating Principles WHEN YOU FINISH READING THIS CHAPTER YOU SHOULD BE ABLE TO: Distinguish between an absolute address and a relative address. Briefly explain the structure of both address types on a traditional IBM mainframe. Explain how the PSW determines the order in which instructions are executed. Distinguish between the BC mode, the EC mode, and the XA mode PSW. Explain how a traditional IBM mainframe determines the length of its instructions. Explain how I/O is controlled on a traditional IBM mainframe. Explain the significance of privileged instructions. Explain how the interrupt concept is implemented on a traditional IBM mainframe. Name the types of interrupts recognized on a traditional IBM mainframe and describe the source of each. List the permanent storage assignments on a traditional IBM mainframe. Explain why certain types of interrupts must be masked at certain times. Explain a traditional IBM mainframe s interrupt priority. 343
2 344 Traditional IBM Mainframe Operating Principles The Hardware Environment An operating system functions within a specific hardware environment; the hardware both limits and supports the software. Initially established with the release of System/360 in 1964, IBM s System/370 architecture was IBM s primary mainframe architecture throughout the 1980s and continues to operate as a virtual machine or virtual environment on IBM s current mainframes. This chapter introduces the basic operating principles of this venerable architecture and is essential for understanding Chapters 18 and 19. Addressing Memory A traditional IBM mainframe is a byte-addressed machine. The bytes are numbered sequentially starting with 0 (Figure 17.1) and grouped to form 16-bit halfwords, 32-bit fullwords, and 64-bit doublewords. The first fullword occupies bytes 0 through 3; the second, bytes 4 through 7; and so on. A fullword s address is simply the address of its first byte 0, 4, 8, and so on. Note that fullword addresses are evenly divisible by 4. In addition to memory, a programmer also has access to 16 general-purpose registers numbered 0 through 15 (0 through F in hexadecimal). Because 15 is 1111 in binary, four bits are enough to uniquely identify a register. Memory addresses can appear as operands in an instruction. Absolute addresses are too long and too inflexible, so relative addresses are used. Programs are written as though they begin at location zero, and the address of any byte in the program is expressed as a displacement from this base. When the program is loaded, its absolute entry point address Doubleword 0 Fullword 0 Fullword 4 Halfword 0 Halfword 2 Halfword 4 Halfword 6 Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Figure 17.1 A traditional IBM mainframe s memory hierarchy.
3 THE PROGRAM STATUS WORD 345 is stored in a base register. As it executes, the instruction control unit converts relative baseplus-displacement addresses to absolute form by adding the displacement to the contents of the base register. Displacements are 12-bits long. Because the largest possible 12-bit number is equivalent to decimal 4095, programs exceeding 4096 bytes (displacements 0 through 4095) require multiple-base registers. To specify a base register (4 bits) and a displacement (12 bits) requires 16 bits or 2 bytes. Thus, a relative base-plus-displacement address occupies 2 bytes. Translating relative addresses to absolute form is a hardware function performed by the processor. Current IBM mainframes incorporate additional dynamic address translation hardware to translate segment/page virtual addresses. The Program Status Word A computer executes one instruction during each machine cycle. The instruction control unit looks to the instruction counter for the address of its next instruction. An IBM mainframe s instruction counter is called the program status word, or PSW. The program status word has three different forms. The basic control (BC) mode (Figure 17.2a) is compatible with the original System/360 architecture, and is used only when the dynamic address translation feature is disabled. The extended control (EC) mode (Figure 17.2b) implies virtual memory; in other words, adding a base register and a displacement yields a virtual address that must be translated through segment and page tables. Bit 12 is set to 0 for the basic control mode, and 1 for extended control. The extended architecture (XA) mode format (Figure 17.2c) resembles EC mode. The primary difference is that the last 31 bits of an XA mode PSW hold the instruction address. In BC and EC modes, the instruction address is only 3 bytes or 24 bits long. The biggest binary number that can be stored in 24 bits is equivalent to 16,777,215, limiting the computer to 16 megabytes of memory. With 31 bits, the largest possible address is slightly over 2 billion, yielding up to 2 gigabytes of memory in XA mode. Bit 32 is set to 0 in EC mode (indicating a 24-bit address) and 1 in XA mode (indicating a 31-bit address). Executing Instructions The program status word (actually, a doubleword) occupies a special system register. Its key function is program control. For example, consider the assembly language program segment shown in Figure It loads binary numbers into registers 3 and 4, adds the numbers, and stores their sum, eventually repeating the instructions. Variables X, Y, and Z are symbolic memory locations (for simplicity, we ll work with the source statements
4 346 Traditional IBM Mainframe Operating Principles BC mode program status word System mask M P X I O 6 E X T Protection key 0 M W P Interruption code ILC CC Program mask Instruction address Figure 17.2 The program status word has three forms. a. Basic control mode. EC mode program status word System mask 0 R T I O E X T Protection key Program 1 M W P 0 0 C C mask Instruction address b. Extended control mode. rather than their machine language equivalents). The numbers to the left of Figure 17.3 are assumed absolute addresses expressed in decimal. The PSW s last 24 (or 31) bits (Figure 17.2) contain the address of the instruction to be executed next. As this program segment begins, the instruction address holds the binary
5 THE PROGRAM STATUS WORD 347 XC mode program status word System mask 0 R T I O 6 E X T Protection key Program 1 M W P 1 0 C C mask Instruction address c. Extended architecture mode. equivalent of the decimal number The processor looks at the PSW, gets the address of the next instruction, and fetches it. Thus, the machine-language equivalent of GO L 3,X is copied into the instruction register. While the instruction is moving from memory to the processor, the instruction control unit has plenty of time to increment the PSW s instruction address field by 4 (the length of the load instruction). Thus the PSW points to 1004, the address of the next instruction. The load instruction s first operand references register 3. The second operand, X, is a symbolic memory address; it will appear as a base register and a displacement. Before the instruction can be executed, that relative address must be converted to absolute, so, the instruction control unit adds the base register and the displacement. If PSW bit 12 is 0, the result is the absolute address. If PSW bit 12 is 1, the dynamic address translation feature is activated, and segment and page tables are used to compute an absolute address. Note carefully the difference between the instruction address in the PSW and the instruction s operand addresses. The PSW holds the absolute address of the instruction. The operands, on the other hand, point to the memory locations that are to participate in the operation. The operand addresses are relative (and, perhaps, virtual), and must be translated to absolute form before the instruction can be executed. Once its operand addresses have been translated, the first instruction is executed and the value stored at location X is copied into register 3. Now, another instruction cycle begins. As before, the processor:
6 348 Traditional IBM Mainframe Operating Principles Figure 17.3 An assembly language program segment. Address Instruction GO L L AR ST 3,X 4,Y 3,4 3,Z Several more instructions 1050 B GO Balance of program X Y Z DS DS DS F F F Other data storage areas 1. finds the instruction address in the PSW, 2. fetches the instruction stored at that address, 3. increments the instruction address so it points to the next instruction, 4. translates the instruction s operands, and 5. executes the instruction. Thus the second load is fetched, the instruction address is incremented to 1008, and the contents of memory location Y are copied into register 4. During the next cycle, the instruction stored at location 1008, is fetched, the instruction address is incremented to 1010, and the contents of registers 3 and 4 are added. Note that the instruction address was incremented by 2 instead of 4 this time. The AR instruction is only 2 bytes long. The PSW points to address Thus, during the next cycle, the store instruction is fetched and executed, and the instruction address is incremented by 4. Continuing in its single-minded way, the processor executes several other instructions until, finally, the instruction address is At this point the instruction B GO is fetched. It s an unconditional branch (a GOTO). The single operand, GO, is a relative (base-plus-displacement) address that must be translated to absolute. When the processor
7 THE PROGRAM STATUS WORD 349 executes an unconditional branch, it replaces the contents of the PSW s instruction address with the address specified in the operand in this case, with Thus, the next instruction to be fetched is the one labeled GO. Instruction Length In the just-completed example (Figure 17.3), most instructions occupied 4 bytes, but one (the AR) needed only 2. Actually, a traditional IBM mainframe computer supports three different instruction lengths (Figure 17.4). Each instruction contains an operation code and two operands. The key to the instruction s length is the number of bytes needed to represent operand addresses. The 16 general-purpose registers are numbered 0 through 15, so a register can be uniquely identified by a 4-bit number. Memory addresses are represented as a base register (4 bits) and a 12-bit displacement, yielding a 16-bit or two-byte relative address. Some instructions involve two registers. Combining a 1-byte operation code with two half-byte register numbers yields a two-byte (halfword) instruction. Other instructions move data between memory and a register. The 1-byte operation code combined with a half-byte register address, a half-byte index register, and a 2-byte memory address, totals 4 bytes. Storage-to-storage instructions include an operation code, two memory addresses, and, frequently, a 1-byte length field, for a total of 6 bytes. How does the processor know the instruction s length? The operation code of every 2- byte, register-to-register instruction begins with bit values 00. Instructions referencing a register and a storage location start with 01 or 10. Storage-to-storage instructions all start with 11. The processor can determine an instruction s length by checking its operation code. Bits 32 and 33 of a BC mode PSW indicate the length of the instruction currently being executed (Figure 17.2); they are set when the instruction address is incremented. The program status word points to the next instruction, not the current one. Using the instruction length code, it is possible to compute the address of the current instruction should an error occur. The instruction length code does not appear in an EC mode PSW. Figure 17.4 A traditional IBM mainframe can execute 2-, 4-, and 6- byte instructions. Register-to-register instructions (2 bytes) Op code R1 R2 Register-to-storage instructions (4 bytes) Op code R1 X B2 Displacement Storage-to-storage instructions (6 bytes) Op code Length B1 Displacement B2 Displacement
8 350 Traditional IBM Mainframe Operating Principles The Condition Code The key to decision logic on a traditional IBM mainframe is a 2-bit condition code in the program status word (bits 34 and 35 in BC mode; bits 18 and 19 in EC mode; see Figure 17.2). Comparison instructions and certain arithmetic instructions set the condition code. When a conditional branch is executed, the processor checks the condition code and, if its value is correct, replaces the PSW s instruction address with an operand address. Memory Protection On a multiprogramming system, it is possible for one program to destroy the contents of memory belonging to another. Thus, most systems include a memory protection feature. On a traditional IBM mainframe, each active program is assigned a 4-bit protection key. The operating system uses 0000; the first program in memory gets 0001, and so on; each program has a different key. Memory is allocated in 2048-byte (2K) blocks. A program s protection key is associated with each block of memory space assigned to it. Later, during program execution, the protection key is stored in PSW bits 8 through 12 (Figure 17.2, both modes). Access to any 2K block whose protection key does not match the one in the PSW is a protection exception, and can cause program termination. Controlling Physical I/O One of the most important elements of a computer s architecture is its link to peripheral devices. External devices are attached to a traditional IBM mainframe through channels. A channel is a special-purpose computer. Because it has its own, independent processor, it can function in parallel with the main processor, and thus free the computer to do other work. Like any computer, a channel executes instructions. Its function is to transfer a certain number of bytes from a peripheral device into memory (or vice versa). Thus, it must be given a byte count and a memory address. The channel program and key control data are stored in the computer s memory and passed to the channel when the I/O operation begins. A channel program consists of one or more channel command words (CCWs) (Figure 17.5). Each CCW contains a command code that specifies the operation to be performed (read, write, seek), a data address, a byte count, and several flags. Programmers can write their own channel programs, but rarely do. Instead, the channel program is typically part of an access method. If the channel program is stored in the computer s memory, how does the channel find it? Just before the main processor sends the channel a start I/O command, the operating system places the address of the first CCW in the channel address word (CAW) (Figure 17.6). The CAW is always found at memory address 72. When the channel s processor receives a start I/O command (1), it copies the channel address word (2) into its own
9 CONTROLLING PHYSICAL I/O 351 instruction counter (Figure 17.7). Then the channel fetches and executes (3) its first channel command word (CCW). The channel passes status information to the computer through the channel status word or CSW (Figure 17.8) at memory address 64. The CSW contains the channel program address, a data address, a byte count, and several flags that indicate the I/O operation s status. The program s protection key is found in both the channel address word and the channel status word. Because the key is in the CAW, the channel can recognize protection exceptions. Following completion of the I/O operation, the operating system uses the protection key in the CSW to identify the program waiting for I/O. Most channel programs are found in access methods. The linkage editor creates a load module by grafting access methods and other subroutines onto the main object module. The main program requests a logical I/O operation by calling the access method (Figure 17.9a). Using parameters passed to it by the calling routine (for example, a data address and a logical record length), the access method completes the channel program and transfers control to the operating system. The operating system stores the address of the channel program s first CCW in the channel address word (memory address 72), and executes a start I/O instruction (Figure 17.9b). The channel responds by copying the channel address word and then fetching the first CCW (Figure 17.9c). At this point, the channel has assumed full responsibility for the I/O operation, and the main computer can process instructions in some other program. Command code Data address Flags Byte count Figure 17.5 The format of a channel command word (CCW). Key 0000 CCW address Address of first CCW in the channel program (24 bits) Memory protection key (4 bits) Figure 17.6 The format of the channel address word (CAW).
10 352 Traditional IBM Mainframe Operating Principles Main processor 1. SIO Channel's processor Main memory CAW 2. Instruction counter Instruction register CCW1 CCW2 CCW3 3. Figure 17.7 Following an SIO command from the main processor, the channel s processor looks to the channel address word to find the first channel command word. Key Command address Status Byte count Figure 17.8 The format of the channel status word (CSW). The channel and the computer are asynchronous; in other words, they function independently. Consequently, the main processor has no way of knowing when the channel has completed its work unless the channel tells it. Thus, when the I/O operation is finished, the channel signals the main processor and reports its status to the operating system through the channel status word (Figure 17.9d). Assuming the CSW indicates successful completion, the operating system can return control to the application program (Figure 17.9e).
11 Channel CSW CAW Operating system routine program partition Primary object module Access method CCW Figure 17.9 Controlling I/O on a traditional IBM mainframe. a. The application program calls the access method, which completes the channel program and transfers control to the operating system. Channel CSW CAW Operating system routine SIO program partition Primary object module Access method CCW b. The operating system stores the address of the channel program in the channel address word and executes a start I/O (SIO) instruction.
12 354 Traditional IBM Mainframe Operating Principles Privileged Instructions On a computer running multiple concurrent programs, it is essential that all input and output operations be funneled through a single operating-system module. To prevent cheating, the instructions that communicate directly with a channel are privileged; in other words, they can be executed only by an operating-system routine. The operating system, remember, is assigned protection key Before executing a privileged instruction, the processor checks the protection key in the PSW. If it s not 0000, a privileged instruction exception is recognized, and the application program is usually terminated. Consequently, to start an I/O operation the programmer must first transfer control to an operating-system module. Interrupts Because the operating system and an application program have different protection keys, it is illegal to branch to or call an operating-system module. The only way for an application program to transfer control to the operating system is by issuing an interrupt. Of course, application programs are not the only source of interrupts; they can originate in hardware or software. A traditional IBM mainframe responds to an interrupt signal by switching PSW s. Three fields are involved: the current PSW, an old PSW, and a new PSW. The current Channel CSW CAW Operating system routine program partition Primary object module Access method CCW c. The channel copies the contents of the channel address word and then fetches the first channel command word.
13 Channel CSW CAW Operating system routine program partition Primary object module Access method CCW d. When the I/O operation is complete, the channel signals the main processor. Channel CSW CAW Operating system routine program partition Primary object module Access method CCW e. After checking the channel status word, the operating system returns control to the application program.
14 356 Traditional IBM Mainframe Operating Principles PSW is the special register that holds the address of the next instruction. The old PSW is located in memory. The new PSW (also found in memory) holds the address of an interrupt handling routine in the operating system. When an interrupt occurs, hardware stores the current program status word in the old PSW field and then loads the new PSW into the current PSW register (Figure 17.10). As the processor begins its next cycle, it fetches the instruction whose address is in the program status word. Because of the interrupt, the current PSW points to the operating system s interrupt handling routine. Note that the old PSW holds the address of the next instruction in the original application program. Thus, after the interrupt has been processed, the application program can be resumed. Sometimes an example helps. Imagine a program loaded at memory location 50,000. The operating system s interrupt handling routine starts at address The new PSW has protection key 0000 and points to instruction address 1000 (Figure 17.11a). The contents of the old PSW are unknown. The current PSW points to memory location (an address in the application program). The program s protection key is When an interrupt occurs, hardware stores the current PSW in the old PSW (Figure 17.11b). A fraction of a nanosecond later, the new PSW is copied into the current PSW (Figure 17.11c). This completes the interrupt. Interrupt processing begins with the next machine cycle. The address in the current PSW is Thus, the processor fetches the first instruction in the interrupt handling routine (Figure 17.11d). Since the protection key is 0000, privileged instructions are legal. Eventually, the old PSW is loaded back into the current PSW and the application program resumes processing (Figure 17.11e). Figure A traditional IBM mainframe responds to an interrupt by storing the current PSW in the old PSW field and then loading the new PSW into the current PSW register. Current program status word 1 Old program status word field 2 New program status word field
15 INTERRUPTS 357 Current PSW Old PSW? Operating system routine New PSW program Figure An example of PSW switching. a. The current PSW points to an instruction in the application program. Current PSW Old PSW Operating system routine New PSW program b. When an interrupt occurs, the current PSW is stored in the old PSW field.
16 358 Traditional IBM Mainframe Operating Principles Interrupt Types Traditional IBM mainframes recognize six different interrupt types. Sources include application programs, peripheral devices, the operator s console, the computer s self-checking error circuitry, and other processors. Current PSW Old PSW Operating system routine New PSW program c. Then the new PSW is loaded into the current PSW register. Current PSW Old PSW Operating system routine New PSW program d. Because the current PSW now points to an operating system routine, the first instruction in the interrupt is fetched.
17 INTERRUPTS 359 Current PSW Old PSW Operating system routine New PSW program e. Eventually, the old PSW s contents are loaded back into the current PSW and the application program resumes processing. External interrupts come from the operator s console, another processor, or the timer. When an external interrupt is sensed, hardware stores the current program status word at memory address 24 (the old external PSW), and then loads the contents of the doubleword beginning at address 88 (the new external PSW) into the current PSW register (Figure 17.12). If the interrupt arrives while the processor is executing an instruction, it is ignored until the instruction is completed; in other words, external interrupts are recognized between instructions. In BC mode, PSW bits 16 through 31 contain an interruption code (Figure 17.2). By checking these 16 bits, the external interrupt routine can determine the exact cause of the interrupt. Under EC mode, the interruption code is stored in a special register. A supervisor call (SVC) interrupt starts when a program executes an SVC instruction, such as SVC 17 The operand requests a particular supervisor module. In response to an SVC instruction, the processor generates an interrupt. Hardware reacts by storing the current program status word at memory address 32 (the old SVC PSW), loading the doubleword beginning at address 96 (the new SVC PSW) into the current PSW, and copying the operand field (the 17 in the instruction illustrated above) into the interruption code (Figure 17.13). An SVC interrupt is generated by a valid instruction. A program interrupt results from an illegal or invalid instruction. The processor recognizes the error as it occurs and generates the interrupt. In response, hardware stores the current PSW into the old program
18 360 Traditional IBM Mainframe Operating Principles PSW field (address 40), loads the new program PSW (address 104) into the current PSW, and stores the interruption code (Figure 17.14). Current PSW 1 24 Old external 2 External interrupt 88 New external Figure An external interrupt. Current PSW 1 32 Old SVC PSW 2 96 New SVC PSW SVC interrupt Figure An SVC interrupt.
19 INTERRUPTS 361 A machine check interrupt occurs when the computer s self-checking circuitry detects a hardware failure. If an instruction is executing, it is terminated no sense performing computations or logical operations on a computer known to be malfunctioning. Hardware responds to a machine check interrupt by storing the current PSW in the old machine check PSW (address 48), loading the new machine check PSW (address 112) into the current PSW, and dumping the contents of key control fields into the next few hundred bytes of memory (Figure 17.15). Because the channels and the main processor work independently, the channel must signal the processor when an I/O operation is completed by sending it an input/output (I/O) interrupt (Figure 17.16). Hardware responds by storing the current PSW in the old I/O PSW (address 56), loading the new I/O PSW (address 120) into the current PSW, and storing the channel/ device address of the unit causing the interrupt in the interruption code. If the processor is executing an instruction when an I/O interrupt occurs, the instruction is completed before the interrupt is recognized. A restart interrupt allows an operator or another processor to start a program. This interrupt type was not available on the original IBM System/360 computers; it was added after the basic architecture was established. The new restart PSW is found at memory location 0; the old restart PSW is at memory location 8. Permanent Storage Assignments The old and new PSWs, the channel status word, and the channel address word are stored in fixed memory locations (Figure 17.17); in other words, these key fields are found at the Current PSW 1 40 Old program 2 Program interrupt 104 New program Figure A program interrupt.
20 362 Traditional IBM Mainframe Operating Principles Current PSW 1 48 Old machine check New machine check Machine check interrupt Figure A machine check interrupt. Current PSW 1 56 Old I/O PSW 2 I/O interrupt 120 New I/O PSW Figure An I/O interrupt. same addresses on every traditional IBM mainframe. They, along with the computer s control registers, represent the primary interface between hardware and software.
21 INTERRUPTS 363 Address Decimal Hexadecimal Length Purpose C Doubleword Doubleword Doubleword Doubleword Doubleword Doubleword Doubleword Doubleword Doubleword Word Word Word Word Doubleword Doubleword Doubleword Doubleword Doubleword Restart new PSW Restart old PSW Unused External old PSW Supervisor call old PSW Program old PSW Machine check old PSW Input/output old PSW Channel status word Channel address word Unused Timer Unused External new PSW Supervisor call new PSW Program new PSW Machine check new PSW Input/output new PSW Figure Fixed locations in memory. Masking Interrupts A typical mainframe computer supports several channels. The channels operate independently, so it is possible that two or more I/O interrupts might be generated by different channels in a very brief time span, perhaps even simultaneously. Consider what might happen if two I/O interrupts were to occur within a few nanoseconds. An application program is executing. In response to the first I/O interrupt, hardware copies the current program status word to the old I/O PSW and loads the new I/O PSW into the current PSW (Figure 17.18a). Within a single machine cycle, a second interrupt arrives. Clearly, the first interrupt is still being processed, but that makes no difference to hardware, which, in its automatic way, drops the current PSW into the old I/O PSW and loads the new I/O PSW (Figure 17.18b). As a result, the link back to the application program is destroyed. Consequently, the operating system will be unable to restart the application program, and that is unacceptable. The solution is masking interrupts. The first eight bits of the BC mode program status word hold a system mask (Figure 17.19a). The first bit is associated with channel 0. If it s 1, the processor can accept an interrupt from the channel; if it s 0, the interrupt is ignored. (The channel will continue to send the interrupt signal, again and again, until the
22 Current PSW Old I/O PSW I/O interrupt routine New I/O PSW Program A Figure Two or more interrupts occurring in a brief time span can destroy the trail back to the original program. a. In response to the first interrupt, the link back to the application program is stored in the old PSW. Current PSW Old I/O PSW I/O interrupt routine New I/O PSW Program A b. The second interrupt overlays the link and thus destroys it.
23 INTERRUPTS 365 processor acknowledges it.) Bits 1 through 5 control channels 1 through 5; again, a 1 bit permits an interrupt from the associated channel, and a 0 bit means the processor will ignore interrupts from that channel. Bit 6 controls channels 6 through 255. In an EC mode PSW (Figure 17.19b), a single bit (bit 6) serves to mask I/O interrupts from all channels. Normally, the system mask or the I/O interrupt bit is set to 1, so I/O interrupts can be accepted. In the new I/O PSW, however, these key mask bits are set to 0 (Figure 17.20). Thus, once an I/O interrupt is accepted, subsequent I/O interrupts are ignored until the operating system changes the PSW. Bit 7 masks external interrupts in all three PSW modes. Like I/O interrupts, external interrupts are generated asynchronously and thus can occur, unexpectedly, at any time. Picture an I/O interrupt, followed closely by an external interrupt, followed closely by another I/O interrupt. That sequence could destroy the original program s PSW in the old I/O PSW field. The same thing could happen with an external, I/O, external sequence. Thus, both I/O and external interrupts are masked when either type is processed. BC mode program status word System mask M P X I O 6 E X T Protection key 0 M W P Interruption code Program (1) or supervisor (0) state Wait (1) or ready (0) state Machine check mask (1 means interrupt permitted) Program mask ILC CC Instruction address Significance Exponent underflow Decimal overflow Fixed point overflow Figure Several program status word bits are used to mask interrupts. a. Basic control mode.
24 366 Traditional IBM Mainframe Operating Principles EC mode program status word System mask 0 R T I O E X T Protection key Program 1 M W P 0 0 C C mask Program (1) or supervisor (0) state Wait (1) or ready (0) state Machine check mask (1 means interrupt permitted) External interrupt mask (1 means interrupt permitted) I/O interrupt mask (1 means interrupt permitted) Dynamic address translation (1 means DAT enabled) Program event recording mask (1 permits program event interrupts) Instruction address b. Extended control mode. The first 32 bits of an extended-architecture (XA) mode PSW are identical. New I/O PSW Mask Key 0000 I/O interrupt address Figure In the new I/O PSW, the I/O interrupt mask bits are set to 0. Consequently, when the new PSW is loaded, all subsequent I/O interrupts are masked while the first one is processed. Machine checks can be masked by turning off PSW bit 13 (all modes). Once a hardware failure is detected, the error checking circuitry sends an interrupt signal, and continues to send signals until the problem is fixed or the machine is shut down. Thus, if machine check interrupts were not masked, hardware, responding to an unending series of interrupt
25 INTERRUPTS 367 signals, would simply load the new machine check PSW over and over again and the system would be unable to respond to the interrupt. Closely spaced SVC and program interrupts are not a problem. Both are generated by program instructions, and, since the processor can execute only one instruction at a time, simultaneous SVC and program interrupts are impossible. An SVC transfers control to the operating system, which has no need to issue a subsequent SVC. (Why call the supervisor when you re already there?) A program interrupt also transfers control to the operating system, which is assumed to be bug free. (In fact, operating-system bugs often lead to a system crash.) Following a program interrupt, normal system action is to terminate the offending program and generate a dump. At times, a programmer may choose to override the standard procedure, trapping and handling such potential problems as overflows or underflows in a program subroutine. Bits 36 through 39 (BC mode) or bits 20 through 23 (EC and XA modes) allow the programmer to suppress fixed-point overflows, decimal overflows, exponent underflows, and significance exceptions. Interrupt Priority If it can possibly happen, it will. Engineers and programmers recognize the essential truth behind that old cliché. Given time, it is almost inevitable that every possible type of interrupt will hit the processor at the same instant. Which one goes first? A well-designed system anticipates such problems and has procedures for dealing with them. On a traditional IBM mainframe, machine checks are serviced first no sense trying to do anything else on a malfunctioning machine. Once the machine check is out of the way, here s what happens (Figure 17.21): 1. The program (or SVC) interrupt is accepted, dropping the application program s PSW into the old program PSW. 2. The external interrupt is accepted, dropping the current PSW (which by now points to the program interrupt handling routine) into the old external PSW. 3. The I/O interrupt is accepted, dropping the external interrupt s program status word into the old I/O PSW. Note that the current PSW points to the I/O interrupt. Additional I/O or external interrupts will be ignored because they are masked. Additional SVC or program interrupts can t possibly happen until another instruction is executed. Thus, the I/O interrupt begins processing. When it finishes, the old I/O PSW is made current and the external interrupt takes over. Finally, the program interrupt gets control. Program States The computer, at any given time, is executing either an application program or a supervisor routine; in other words, it is either in the problem state or the supervisory state. PSW
26 368 Traditional IBM Mainframe Operating Principles 1 New external 2 New external 3 New I/O Program A New external New SVC New program New mach-check New I/O New program Program A New external New SVC New program New mach-check New I/O New program Program A New external New external New SVC New program New mach-check New I/O Figure When simultaneous interrupts occur, hardware accepts the program (or SVC) interrupt first, then the external interrupt, and finally the I/O interrupt. They are processed in reverse order. bit 15 (all modes) (Figure 17.19) indicates the computer s state 1 means problem and 0 means supervisory. Privileged instructions can be executed only in supervisory state. Protection exceptions are ignored when the system is in supervisory state. Additionally, a given program is either ready to resume processing or waiting for the completion of some event such as an I/O operation; in other words, it s either in a ready state or a wait state. A 0 in PSW bit 14 means ready; a 1 means wait. As you ll see in subsequent chapters, this bit is crucial on a multiprogramming system. Three other EC and XA mode bits deserve mention. Bit 1 is associated with program event recording (a facility we won t cover in detail). Bit 5 controls dynamic address translation. If it s set to 0, addresses are not dynamically translated (which makes sense for operating-system routines in the virtual-equals-real area). If bit 5 is set to 1, addresses are dynamically translated through the segment and page tables. Finally, bit 16 affects dynamic address translation. It must be set to 0 in EC mode and to 1 in XA mode.
27 AN EXAMPLE 369 An Example Perhaps the best way to pull together all these concepts is through an example. Start with a single program in memory (Figure 17.22a). The program needs data and thus executes an SVC. The result is an SVC interrupt (Figure 17.22b), which transfers control to the SVC interrupt (Figure 17.22c). Note that the old SVC PSW points to the application program. The SVC interrupt starts the physical I/O operation (Figure 17.22d) by: 1. storing the address of the first channel command word in the channel address word, and 2. executing a start I/O instruction, which signals the channel. Before returning control to the initial program, the operating system repeatedly checks the channel status word (CSW) until the channel reports either a successful or unsuccessful start (Figure 17.22e). Assuming success, the channel is now responsible for the I/O operation so the interrupt places the application program in a wait state by turning on bit 14. Next, the operating system tries to start another program. Since there is only one application program in memory, its old PSW is loaded (Figure 17.22f). Because PSW bit 14 is set to 1, the computer is in a wait state, so the processor does nothing for a while. Eventually, the channel completes the input operation and sends an I/O interrupt to the processor. Consequently, the current PSW is copied to the old I/O PSW and the new I/O PSW is loaded (Figure 15.22g). The current PSW s bit 14 is now 0, so the processor can execute instructions. The first instruction in the I/O interrupt routine is fetched. The channel status word is checked, and the application program s PSW is set to a ready state. Eventually (Figure 17.22h), the application program resumes processing. With multiprogramming, of course, the problem is a bit more complex. If a program drops into a wait state, the operating system will attempt to start a different one, and the new program is likely to generate its own interrupts. Because there is only one old PSW for each interrupt type, the original program s PSW must be saved if a return trail is to be preserved. We ll consider this problem in the next two chapters. Summary Traditional IBM mainframes are byte addressed. The bytes are grouped to form halfwords, fullwords, and doublewords. Memory addresses appearing in instruction operands are expressed in relative, base-plus-displacement form, and must be translated to absolute form before the instruction can be executed. A traditional IBM mainframe s instruction counter is called the program status word. It holds the address of the next instruction to be executed. Three forms, the basic control (BC) mode, the extended control (EC) mode, and the extended architecture (XA) mode,
28 PSW Channel Old SVC PSW Old I/O PSW CSW CAW New SVC PSW I/O interrupt SVC interrupt New I/O PSW program CCWs Figure An example. a. Memory holds a single application program. PSW Channel Old SVC PSW Old I/O PSW CSW CAW New SVC PSW I/O interrupt SVC interrupt New I/O PSW program CCWs b. The program issues an SVC.
29 PSW Channel Old SVC PSW Old I/O PSW CSW CAW New SVC PSW I/O interrupt SVC interrupt New I/O PSW program CCWs c. The SVC interrupt begins executing. PSW Channel Old SVC PSW Old I/O PSW CSW CAW New SVC PSW I/O interrupt SVC interrupt (SIO) New I/O PSW To processor program CCWs d. The interrupt starts the physical I/O operation by storing the channel program address in the channel status word and executing a start I/O instruction.
30 PSW Channel Old SVC PSW Old I/O PSW CSW CAW New SVC PSW I/O interrupt SVC interrupt (SIO) New I/O PSW program CCWs e. The SVC interrupt then checks the channel status word until the channel reports the I/O operation s status. PSW - Wait state Channel Old SVC PSW Old I/O PSW CSW CAW New SVC PSW I/O interrupt SVC interrupt (SIO) New I/O PSW program CCWs f. The application program s PSW is loaded from the old SVC PSW. Because the application program is in a wait state, the processor is in a wait state.
31 To processor PSW Channel Old SVC PSW Old I/O PSW CSW CAW New SVC PSW I/O interrupt SVC interrupt (SIO) New I/O PSW program CCWs g. Following an I/O interrupt (from the channel), the I/O interrupt gets control. PSW - Run state Channel Old SVC PSW Old I/O PSW CSW CAW New SVC PSW I/O interrupt SVC interrupt (SIO) New I/O PSW program CCWs h. Eventually, the application program resumes processing.
32 374 Traditional IBM Mainframe Operating Principles are used. The instruction length code (BC mode only), condition code, and protection key are all found in the PSW. An application program starts an I/O operation by calling an access method. The access method completes a channel program (one or more channel command words) and transfers control to the operating system. The operating system, in turn, stores the address of the first CCW in the channel address word (CAW) and issues a privileged start I/O instruction. When the I/O operation is completed, the channel notifies the processor by sending an interrupt and reporting its status through the channel status word (CSW). A traditional IBM mainframe responds to an interrupt by storing the current PSW in the old PSW field, and loading the new PSW into the current PSW. Six types of interrupts are supported: external, I/O, program, SVC, machine check, and restart. Each type has its own old and new PSW fields. To avoid losing the trail back to the original program, I/O and external interrupts are masked. Machine check interrupts and selected program interrupts can be masked, too. Given simultaneous interrupts, the program (or SVC) interrupt is accepted first, then the external interrupt, and, finally, the I/O interrupt. They are processed in reverse order. Other PSW bits identify a program s state, activate the dynamic address translation feature, and control program event recording. The chapter ended with an example. If you haven t already done so, take the time to read and understand that example.
33 EXERCISES 375 Key Words Exercises 1. A traditional IBM mainframe is a byte-addressed machine. Explain. 2. Distinguish between an absolute address and a relative address. Briefly explain the structure of both address types on a traditional IBM mainframe. 3. Explain how the PSW determines the order in which instructions are executed. 4. Distinguish between the BC mode, the EC mode, and the XA mode PSWs. When is each used? How do the PSWs differ? 5. How can a traditional IBM mainframe determine the length of its instructions? What distinguishes 2-byte, 4-byte, and 6-byte instructions? 6. Explain how I/O is controlled on a traditional IBM mainframe. What functions are performed by the access method, the channel program, the channel command word, the channel address word, the operating system, and the channel status word. 7. What is a privileged instruction? Why are such instructions important? 8. What is an interrupt? How is the interrupt concept implemented on a traditional IBM mainframe? 9. Name the types of interrupts recognized on a traditional IBM mainframe. Describe the source of each. 10. What are permanent storage assignments? Why are they necessary on a traditional IBM mainframe? 11. Why must certain types of interrupts be masked at certain times? How are they masked? 12. Explain a traditional IBM mainframe s interrupt priority.
34 376 Traditional IBM Mainframe Operating Principles 13. Assume a traditional IBM mainframe is running under basic control mode. The contents of certain fixed locations in memory are Address Contents in Hexadecimal 0 FF C C FF C FF55 000B C003 F C004 A C004 22FA A FF FF The current PSW holds: FF04 000B Sketch a map of memory showing the location of each interrupt handling routine. What kind of interrupt has just happened? What is the address of the bad instruction? Can an I/O interrupt happen now? How do you know? Can a privileged instruction be executed? How can you tell the computer is in basic control (BC) mode?
150127-Microprocessor & Assembly Language
Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an
MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1
MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable
Chapter 1 Computer System Overview
Operating Systems: Internals and Design Principles Chapter 1 Computer System Overview Eighth Edition By William Stallings Operating System Exploits the hardware resources of one or more processors Provides
Introduction. What is an Operating System?
Introduction What is an Operating System? 1 What is an Operating System? 2 Why is an Operating System Needed? 3 How Did They Develop? Historical Approach Affect of Architecture 4 Efficient Utilization
MICROPROCESSOR AND MICROCOMPUTER BASICS
Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit
Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2
Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of
Exception and Interrupt Handling in ARM
Exception and Interrupt Handling in ARM Architectures and Design Methods for Embedded Systems Summer Semester 2006 Author: Ahmed Fathy Mohammed Abdelrazek Advisor: Dominik Lücke Abstract We discuss exceptions
1 Description of The Simpletron
Simulating The Simpletron Computer 50 points 1 Description of The Simpletron In this assignment you will write a program to simulate a fictional computer that we will call the Simpletron. As its name implies
Mainframe Operating Systems Boot Camp
Robert Rannie Milica Kozomara Northern Illinois University - DeKalb, IL Texas Instruments - Dallas, TX Our Agenda for the Week Mainframe Operating Systems Boot Camp From IPL to Running Programs Part 2
MACHINE INSTRUCTIONS AND PROGRAMS
CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER OBJECTIVES In this chapter you will learn about: Machine instructions and program execution, including branching and subroutine call and return operations
Base Conversion written by Cathy Saxton
Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,
CPU Organization and Assembly Language
COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:
(Refer Slide Time: 00:01:16 min)
Digital Computer Organization Prof. P. K. Biswas Department of Electronic & Electrical Communication Engineering Indian Institute of Technology, Kharagpur Lecture No. # 04 CPU Design: Tirning & Control
Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine
7 Objectives After completing this lab you will: know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine Introduction Branches and jumps provide ways to change
An Introduction to the ARM 7 Architecture
An Introduction to the ARM 7 Architecture Trevor Martin CEng, MIEE Technical Director This article gives an overview of the ARM 7 architecture and a description of its major features for a developer new
ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)
ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) 1 COMPUTER LANGUAGES In order for a computer to be able to execute a program, the program must first be present
Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan
Chapter 2 Basic Structure of Computers Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Outline Functional Units Basic Operational Concepts Bus Structures Software
Let s put together a Manual Processor
Lecture 14 Let s put together a Manual Processor Hardware Lecture 14 Slide 1 The processor Inside every computer there is at least one processor which can take an instruction, some operands and produce
CSC 2405: Computer Systems II
CSC 2405: Computer Systems II Spring 2013 (TR 8:30-9:45 in G86) Mirela Damian http://www.csc.villanova.edu/~mdamian/csc2405/ Introductions Mirela Damian Room 167A in the Mendel Science Building [email protected]
PART B QUESTIONS AND ANSWERS UNIT I
PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional
Chapter 6, The Operating System Machine Level
Chapter 6, The Operating System Machine Level 6.1 Virtual Memory 6.2 Virtual I/O Instructions 6.3 Virtual Instructions For Parallel Processing 6.4 Example Operating Systems 6.5 Summary Virtual Memory General
Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.
1 Topics Machine Architecture and Number Systems Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting from Decimal to Binary Major Computer Components
Systems I: Computer Organization and Architecture
Systems I: Computer Organization and Architecture Lecture : Microprogrammed Control Microprogramming The control unit is responsible for initiating the sequence of microoperations that comprise instructions.
We r e going to play Final (exam) Jeopardy! "Answers:" "Questions:" - 1 -
. (0 pts) We re going to play Final (exam) Jeopardy! Associate the following answers with the appropriate question. (You are given the "answers": Pick the "question" that goes best with each "answer".)
Hardware Assisted Virtualization
Hardware Assisted Virtualization G. Lettieri 21 Oct. 2015 1 Introduction In the hardware-assisted virtualization technique we try to execute the instructions of the target machine directly on the host
MACHINE ARCHITECTURE & LANGUAGE
in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based
PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1
UNIT 22: PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1 This work covers part of outcome 2 of the Edexcel standard module. The material is
Computer-System Architecture
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection General System Architecture 2.1 Computer-System Architecture 2.2 Computer-System
LADDER LOGIC/ FLOWCHART PROGRAMMING DIFFERENCES AND EXAMPLES
page 1/10 This document is designed as a quick-start primer to assist industrial automation programmers who are familiar with PLCs and Relay Ladder Logic programming to better understand the corresponding
Application Note 195. ARM11 performance monitor unit. Document number: ARM DAI 195B Issued: 15th February, 2008 Copyright ARM Limited 2007
Application Note 195 ARM11 performance monitor unit Document number: ARM DAI 195B Issued: 15th February, 2008 Copyright ARM Limited 2007 Copyright 2007 ARM Limited. All rights reserved. Application Note
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV UNIT I THE 8086 MICROPROCESSOR 1. What is the purpose of segment registers
Chapter 2 Logic Gates and Introduction to Computer Architecture
Chapter 2 Logic Gates and Introduction to Computer Architecture 2.1 Introduction The basic components of an Integrated Circuit (IC) is logic gates which made of transistors, in digital system there are
CHAPTER 4 MARIE: An Introduction to a Simple Computer
CHAPTER 4 MARIE: An Introduction to a Simple Computer 4.1 Introduction 195 4.2 CPU Basics and Organization 195 4.2.1 The Registers 196 4.2.2 The ALU 197 4.2.3 The Control Unit 197 4.3 The Bus 197 4.4 Clocks
Introduction to LogixPro - Lab
Programmable Logic and Automation Controllers Industrial Control Systems I Introduction to LogixPro - Lab Purpose This is a self-paced lab that will introduce the student to the LogixPro PLC Simulator
PIC Programming in Assembly. (http://www.mstracey.btinternet.co.uk/index.htm)
PIC Programming in Assembly (http://www.mstracey.btinternet.co.uk/index.htm) Tutorial 1 Good Programming Techniques. Before we get to the nitty gritty of programming the PIC, I think now is a good time
Programming Logic controllers
Programming Logic controllers Programmable Logic Controller (PLC) is a microprocessor based system that uses programmable memory to store instructions and implement functions such as logic, sequencing,
EC 362 Problem Set #2
EC 362 Problem Set #2 1) Using Single Precision IEEE 754, what is FF28 0000? 2) Suppose the fraction enhanced of a processor is 40% and the speedup of the enhancement was tenfold. What is the overall speedup?
Modbus Protocol. PDF format version of the MODBUS Protocol. http://www.http://www.modicon.com/techpubs/toc7.html. The original was found at:
Modbus Protocol PDF format version of the MODBUS Protocol The original was found at: http://www.http://www.modicon.com/techpubs/toc7.html (In case of any discrepancies, that version should be considered
Operating Systems 4 th Class
Operating Systems 4 th Class Lecture 1 Operating Systems Operating systems are essential part of any computer system. Therefore, a course in operating systems is an essential part of any computer science
A s we saw in Chapter 4, a CPU contains three main sections: the register section,
6 CPU Design A s we saw in Chapter 4, a CPU contains three main sections: the register section, the arithmetic/logic unit (ALU), and the control unit. These sections work together to perform the sequences
Chapter 11: Input/Output Organisation. Lesson 06: Programmed IO
Chapter 11: Input/Output Organisation Lesson 06: Programmed IO Objective Understand the programmed IO mode of data transfer Learn that the program waits for the ready status by repeatedly testing the status
The string of digits 101101 in the binary number system represents the quantity
Data Representation Section 3.1 Data Types Registers contain either data or control information Control information is a bit or group of bits used to specify the sequence of command signals needed for
Chapter 2: OS Overview
Chapter 2: OS Overview CmSc 335 Operating Systems 1. Operating system objectives and functions Operating systems control and support the usage of computer systems. a. usage users of a computer system:
S7 for Windows S7-300/400
S7 for Windows S7-300/400 A Programming System for the Siemens S7 300 / 400 PLC s IBHsoftec has an efficient and straight-forward programming system for the Simatic S7-300 and ern controller concept can
what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?
Inside the CPU how does the CPU work? what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? some short, boring programs to illustrate the
PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1
UNIT 22: PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1 This work covers part of outcome 3 of the Edexcel standard module: Outcome 3 is the most demanding
Central Processing Unit
Chapter 4 Central Processing Unit 1. CPU organization and operation flowchart 1.1. General concepts The primary function of the Central Processing Unit is to execute sequences of instructions representing
Computer Organization. and Instruction Execution. August 22
Computer Organization and Instruction Execution August 22 CSC201 Section 002 Fall, 2000 The Main Parts of a Computer CSC201 Section Copyright 2000, Douglas Reeves 2 I/O and Storage Devices (lots of devices,
Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX
Overview CISC Developments Over Twenty Years Classic CISC design: Digital VAX VAXÕs RISC successor: PRISM/Alpha IntelÕs ubiquitous 80x86 architecture Ð 8086 through the Pentium Pro (P6) RJS 2/3/97 Philosophy
The Hexadecimal Number System and Memory Addressing
APPENDIX C The Hexadecimal Number System and Memory Addressing U nderstanding the number system and the coding system that computers use to store data and communicate with each other is fundamental to
Subnetting Examples. There are three types of subnetting examples I will show in this document:
Subnetting Examples There are three types of subnetting examples I will show in this document: 1) Subnetting when given a required number of networks 2) Subnetting when given a required number of clients
8085 INSTRUCTION SET
DATA TRANSFER INSTRUCTIONS Opcode Operand Description 8085 INSTRUCTION SET INSTRUCTION DETAILS Copy from source to destination OV Rd, Rs This instruction copies the contents of the source, Rs register
Counters. Present State Next State A B A B 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0
ounter ounters ounters are a specific type of sequential circuit. Like registers, the state, or the flip-flop values themselves, serves as the output. The output value increases by one on each clock cycle.
How to design and implement firmware for embedded systems
How to design and implement firmware for embedded systems Last changes: 17.06.2010 Author: Rico Möckel The very beginning: What should I avoid when implementing firmware for embedded systems? Writing code
TIMING DIAGRAM O 8085
5 TIMING DIAGRAM O 8085 5.1 INTRODUCTION Timing diagram is the display of initiation of read/write and transfer of data operations under the control of 3-status signals IO / M, S 1, and S 0. As the heartbeat
To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:
Binary Numbers In computer science we deal almost exclusively with binary numbers. it will be very helpful to memorize some binary constants and their decimal and English equivalents. By English equivalents
Development of 360/370 Architecture - A Plain Man's View
Development of 360/370 Architecture - A Plain Man's View February 10th, 1989 P.J. Gribbin (Gvn/PJG) EDS c/o Rolls-Royce Plc P.O. Box 31 Derby England, DE24 8BJ Tel:- +44-1332-522016 [email protected]
PROBLEMS (Cap. 4 - Istruzioni macchina)
98 CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS PROBLEMS (Cap. 4 - Istruzioni macchina) 2.1 Represent the decimal values 5, 2, 14, 10, 26, 19, 51, and 43, as signed, 7-bit numbers in the following binary
1. Computer System Structure and Components
1 Computer System Structure and Components Computer System Layers Various Computer Programs OS System Calls (eg, fork, execv, write, etc) KERNEL/Behavior or CPU Device Drivers Device Controllers Devices
CPU Organisation and Operation
CPU Organisation and Operation The Fetch-Execute Cycle The operation of the CPU 1 is usually described in terms of the Fetch-Execute cycle. 2 Fetch-Execute Cycle Fetch the Instruction Increment the Program
================================================================
==== ==== ================================================================ DR 6502 AER 201S Engineering Design 6502 Execution Simulator ================================================================
BASIC COMPUTER ORGANIZATION AND DESIGN
1 BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle Memory Reference Instructions Input-Output and Interrupt Complete
6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10
Lesson The Binary Number System. Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as the base- system. When you
Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization
Lesson Objectives To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization AE3B33OSD Lesson 1 / Page 2 What is an Operating System? A
Notes on Assembly Language
Notes on Assembly Language Brief introduction to assembly programming The main components of a computer that take part in the execution of a program written in assembly code are the following: A set of
DATA ITEM DESCRIPTION
DD Form 1664, APR 89 Previous editions are obsolete Page 1 of 4 Pages 135/123 DATA ITEM DESCRIPTION Form Approved OMB NO.0704-0188 Public reporting burden for collection of this information is estimated
Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek
Instruction Set Architecture or How to talk to computers if you aren t in Star Trek The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture
Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines Operating System Concepts 3.1 Common System Components
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine
3BASIC RELAY INSTRUCTIONS
M O D U L E T H R E E 3BASIC RELAY INSTRUCTIONS Key Points So far, you have learned about the components of the MicroLogix 1000 PLC, including the CPU, the memory system, the power supply, and the input/output
M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE
M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 1. Introduction 6.004 Computation Structures β Documentation This handout is
A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc
Other architectures Example. Accumulator-based machines A single register, called the accumulator, stores the operand before the operation, and stores the result after the operation. Load x # into acc
CHAPTER 7: The CPU and Memory
CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides
Lecture N -1- PHYS 3330. Microcontrollers
Lecture N -1- PHYS 3330 Microcontrollers If you need more than a handful of logic gates to accomplish the task at hand, you likely should use a microcontroller instead of discrete logic gates 1. Microcontrollers
Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.
Objectives To describe the services an operating system provides to users, processes, and other systems To discuss the various ways of structuring an operating system Chapter 2: Operating-System Structures
Two's Complement Adder/Subtractor Lab L03
Two's Complement Adder/Subtractor Lab L03 Introduction Computers are usually designed to perform indirect subtraction instead of direct subtraction. Adding -B to A is equivalent to subtracting B from A,
Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur
Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 04 Digital Logic II May, I before starting the today s lecture
Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)
Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating
Operating system Dr. Shroouq J.
3 OPERATING SYSTEM STRUCTURES An operating system provides the environment within which programs are executed. The design of a new operating system is a major task. The goals of the system must be well
Operating Systems. Lecture 03. February 11, 2013
Operating Systems Lecture 03 February 11, 2013 Goals for Today Interrupts, traps and signals Hardware Protection System Calls Interrupts, Traps, and Signals The occurrence of an event is usually signaled
Communication Protocol
Analysis of the NXT Bluetooth Communication Protocol By Sivan Toledo September 2006 The NXT supports Bluetooth communication between a program running on the NXT and a program running on some other Bluetooth
Serial Communications
Serial Communications 1 Serial Communication Introduction Serial communication buses Asynchronous and synchronous communication UART block diagram UART clock requirements Programming the UARTs Operation
a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.
CS143 Handout 18 Summer 2008 30 July, 2008 Processor Architectures Handout written by Maggie Johnson and revised by Julie Zelenski. Architecture Vocabulary Let s review a few relevant hardware definitions:
Chapter 11 I/O Management and Disk Scheduling
Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ 2008, Prentice Hall I/O Devices Roadmap Organization
Chapter 2 Assemblers http://www.intel.com/multi-core/demos.htm
Chapter 2 Assemblers http://www.intel.com/multi-core/demos.htm Source Program Assembler Object Code Linker Executable Code Loader 1 Outline 2.1 Basic Assembler Functions A simple SIC assembler Assembler
Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer
Computers CMPT 125: Lecture 1: Understanding the Computer Tamara Smyth, [email protected] School of Computing Science, Simon Fraser University January 3, 2009 A computer performs 2 basic functions: 1.
Read this before starting!
Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 4717 Computer Architecture TEST 2 for Fall Semester, 2006 Section
Origins of Operating Systems OS/360. Martin Grund HPI
Origins of Operating Systems OS/360 HPI Table of Contents IBM System 360 Functional Structure of OS/360 Virtual Machine Time Sharing 2 Welcome to Big Blue 3 IBM System 360 In 1964 IBM announced the IBM-360
CHAPTER 11: Flip Flops
CHAPTER 11: Flip Flops In this chapter, you will be building the part of the circuit that controls the command sequencing. The required circuit must operate the counter and the memory chip. When the teach
Instruction Set Architecture
Instruction Set Architecture Consider x := y+z. (x, y, z are memory variables) 1-address instructions 2-address instructions LOAD y (r :=y) ADD y,z (y := y+z) ADD z (r:=r+z) MOVE x,y (x := y) STORE x (x:=r)
Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8
ECE Department Summer LECTURE #5: Number Systems EEL : Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz Decimal Number System: -Our standard number system is base, also
Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview
Technical Note TN-29-06: NAND Flash Controller on Spartan-3 Overview Micron NAND Flash Controller via Xilinx Spartan -3 FPGA Overview As mobile product capabilities continue to expand, so does the demand
Contents COUNTER. Unit III- Counters
COUNTER Contents COUNTER...1 Frequency Division...2 Divide-by-2 Counter... 3 Toggle Flip-Flop...3 Frequency Division using Toggle Flip-flops...5 Truth Table for a 3-bit Asynchronous Up Counter...6 Modulo
Computer Organization & Architecture Lecture #19
Computer Organization & Architecture Lecture #19 Input/Output The computer system s I/O architecture is its interface to the outside world. This architecture is designed to provide a systematic means of
AN10850. LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode
LPC1700 timer triggered memory to GPIO data transfer Rev. 01 16 July 2009 Application note Document information Info Keywords Abstract Content LPC1700, GPIO, DMA, Timer0, Sleep Mode This application note
DS1621 Digital Thermometer and Thermostat
Digital Thermometer and Thermostat www.dalsemi.com FEATURES Temperature measurements require no external components Measures temperatures from 55 C to +125 C in 0.5 C increments. Fahrenheit equivalent
Outline. Lecture 3. Basics. Logical vs. physical memory. 8086 physical memory. x86 byte ordering
Outline Lecture 3 bout Memory ddressing memory Data types MOV instruction ddressing modes Instruction format Dr. Dimitrios S. Nikolopoulos SL/UIU Basics Logical vs. physical memory Memory in the x processors
CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions
CS101 Lecture 26: Low Level Programming John Magee 30 July 2013 Some material copyright Jones and Bartlett 1 Overview/Questions What did we do last time? How can we control the computer s circuits? How
Chapter 7 Memory Management
Operating Systems: Internals and Design Principles Chapter 7 Memory Management Eighth Edition William Stallings Frame Page Segment A fixed-length block of main memory. A fixed-length block of data that
COMPUTER HARDWARE. Input- Output and Communication Memory Systems
COMPUTER HARDWARE Input- Output and Communication Memory Systems Computer I/O I/O devices commonly found in Computer systems Keyboards Displays Printers Magnetic Drives Compact disk read only memory (CD-ROM)
