CS 1104 AY2019 T3 Unit 6 Discussion Assignment PDF

Title CS 1104 AY2019 T3 Unit 6 Discussion Assignment
Author Ahmed Nassar
Course Computer Systems
Institution University of the People
Pages 22
File Size 898.1 KB
File Type PDF
Total Downloads 114
Total Views 145

Summary

CS 1104 AY2019 T3 Unit 6 Discussion Assignment...


Description

3/12/2019

CS 1104 - AY2019-T3: AY2019-T3: Unit Unit 66 Discussion Discussion Assignment Assignment

HOME

CONT CONTACT ACT US

RESOURCES

LINKS

FACUL ACULT TY

MY COURSES

MENU

CS 1104 Computer Systems - Term 3, 2018-2019 Home ► My courses ► CS 1104 - AY2019-T3 ► 7 March - 13 March ► Discussion Forum Unit 6 ► Unit 6 Discussion Assignment Search forums

Discussion Forum Unit 6 Unit 6 Discussion Assignment Subscribe

Unit 6 Discussion Assignment by Onyekwere Oluoha (Instructor) - Wednesday, 30 January 2019, 5:38 AM For your discussion question response, please provide a response to each of the following questions. Make sure that you include the question followed by your answer to the question in your posting. In the description of the Hack machine language in chapter 4, it is stated that in wellwritten programs, a C-instruction that may cause a jump should not contain a reference to M, and vice versa. Discuss why this should be avoided. Research the concept of interrupts in a computer. You may want to look into how the Z80 microprocessor handles interrupts. A good source of Z80 information is the Rodnay Zaks book, "How to Program the Z80."

FYI, The Z80 8 bit microprocessor has been in production for forty years. Knowledge of the Z80 is a great lead in for further study in more complicated machines. 138 words

Permalink | Reply

Re: Unit 6 Discussion Assignment by Benjamin Silverio Tubbs - Saturday, 9 March 2019, 6:28 AM https://my.uopeople.edu/mod/forum/discuss.php?d=191797

1/22 2/22

In the description of the Hack machine language in chapter 4, it is stated that in well- written programs, a C-instruction that may cause a jump should not contain a reference to M, and vice versa. Discuss why this should be avoided. The Hack architecture consists of two 16 bit data registers. One is a data register called D, and the other is an address register called A. The data register D can only be used to store data, but the address register A can be used to store either data or addresses (Nisan & Schocken, 2008). As the program is executing, the data in the A register will be interpreted different based upon whether or not there is a jump. There are two types of instructions that get sent between the A register and the CPU. One is called an A instruction that will contain information about addresses which are the locations of the data and instructions to be executed by the CPU (Nisan & Schocken, 2008). The other type are called compute instructions or C instructions. The C instructions are much more complicated, but they simply contain information about what operation to perform, where to store that information and whether or the system would like to perform a jump (Nisan & Schocken, 2008). The system chooses which operation to perform generally by simply incrementing to the next instruction and performing the instructions in order. However, there are times when some of the instructions are skipped over and the system proceeds from a new part of the program. This is called a jump. The jump information is in the rightmost part of a C instruction and is three bits long. When all three bits are set to zero, then the system will never perform a jump under any conditions. When one or more of the bits is set to one, then the system may perform a jump. As mentioned above, there is a part of the C value that tells the computer where to store the value. The value can be stored in one of three places: in D register, the A register, or in the memory register that is addressed by A (referred to as M). As you can see this cause could potentially cause a bit of problem.

3/12/2019

CS 1104 - AY2019-T3: Unit 6 Discussion Assignment If we have a jump, then we need interpret the instruction in A as an instruction to be executed, but if the destination part of the memory is telling us to store the value in the memory location referenced by A, then we we need to interpret the same value as the address of a memory location, referred to as M.

Our issue is that the the value in M may be interpreted in at least two ways. As a RAM memory location to store the value of the most recent calculation or as a Rom memory location to which we need to jump. This is why we need to be very careful. When we could be potentially jumping. If M contains a information about data or a RAM memory location and we jump, this may cause us to jump to an incorrect address in the ROM memory location. Likewise if M contains information about a ROM memory location, it may accidentally be interpreted as a memory location in RAM which would cause incorrect calculations or values to be stored incorrectly in RAM. The way to solve this issue is to ensure that any instruction that does not have the three jump bits set to 000 to have no reference to M. And vice versa, any instruction that contains a reference to M (final bit of destination bits 1, for example, 001) should always have the final three bits (jump bits) set to 000. Research the concept of interrupts in a computer. You may want to look into how the Z80 microprocessor handles interrupts. A good source of Z80 information is the Rodnay Zaks book, "How to Program the Z80." Everything we have talked about so far is how the CPU handles instructions that are coming from a prewritten program like a ROM, but this is not the only type of instruction that the CPU needs to be able to deal with. There are other instructions that the CPU needs to be able to execute such as events from the user like a click or movement of the mouse or a keystroke on a keyboard. One way to deal with this would be for the CPU to periodically send signals to each of these devices to check if the device has received an event. This technique is called polling and has two huge drawbacks. One is that usually input devices are not being used and as such it is a huge waste of CPU resources to be constantly polling them for event handling (Whatis, 2016). The second issue is that the event will not be received until the next poll which causes a huge amount of latency before the CPU gets to the event (Whatis, 2016).

https://my.uopeople.edu/mod/forum/discuss.php?d=191797

3/22

3/12/2019

CS 1104 - AY2019-T3: Unit 6 Discussion Assignment The other solution to this problem is to give the input devices the ability to send the CPU a signal when they would like the attention of the CPU. When a signal is received from the input device, then the CPU can halt the instructions of the code that it is executing currently and begin handling the event of the input device that is requesting its attention at the beginning of the next fetch and execute cycle (Whatis, 2016). Since the event interrupts the current execution of the CPU code, this technique is called an interrupt.

The interrupt instructions are added to a stack with the address location of the instruction the CPU was executing previously at the bottom to ensure that the CPU goes back to the process it was executing before the interrupt occurred after it is done handling the interrupt. The Z80 processor implements this with three different modes that allow for internal and external interrupts to be handled in a variety of different ways. Certain modes prioritize internal interrupts and other user interrupts and some send the CPU to a specific memory location while others deal with the user instruction (Sgate, n.d.). The delay ends up being a fraction of a second to deal with the interrupt (Wikidot, 2009). References Nisan, N., & Schocken, S. (2008). The elements of computing systems: Building a modern computer from first principles. Cambridge Mass.: The MIT Press. Sgate. (n.d.). Instructions: Hardware Related. Retrieved March 9, 2019, from http://sgate.emt.bme.hu/patai/publications/z80guide/app1d.html Whatis. (2016, December). What is interrupt? - Definition from WhatIs.com. Retrieved March 9, 2019, from https://whatis.techtarget.com/definition/interrupt Wikidot. (2009, April 4). Z80 Heaven. Retrieved March 9, 2019, from http://z80heaven.wikidot.com/interrupts#toc2 1126 words

Rate: Rate...

Permalink | Show parent | Reply

Re: Unit 6 Discussion Assignment by Onyekwere Oluoha (Instructor) - Sunday, 10 March 2019, 10:30 AM Hello Benjamin/Class,

https://my.uopeople.edu/mod/forum/discuss.php?d=191797

4/22

3/12/2019

CS 1104 - AY2019-T3: Unit 6 Discussion Assignment I enjoyed reading your post. Your esplanation as regards the interrupt was very lucid. As a recap, Zilog Corporation’s Z80, was a simple microprocessor chip with an 8bit architecture, and was first released in 1976. It featured a single interrupt line, which supports three interrupt modes (control bits) designated as 0, 1 and 2. Interrupts negotiate the use of this line using the hardware based daisy-chain method, with the nearest peripheral chip to the power line on the daisy-chain having the greatest priority (Moore, 1997).

The newer z80,000 microprocessor is an intriguing 32-bit processor chip used for general purpose desktop computing, array processing and graphics. With a flexible, yet simple and regular architecture, the z80,000 microprocessor has very high performance and sundry advantages. Some of its marked features includes on-chip cache memory and virtual memory management, burst memory transfer, architecture featuring six-stage pipeline and multiprocessing support (Patel, n.d.) the z80,000 microprocessor was built to support three types of interrupts including nonmaskable interrupts, vectored interrupts and non- vectored interrupts, with the vectored interrupts and non- vectored interrupts having a mask bit in flag and control word (FCW).

OLuOHA.

References Moore M. (1997) “Z80® Family Interrupt Structure” online. Retrived from: http://www.z80.info/1653.htm Patel A. (n.d.) “An inside look at the Z80,OOO CPU: Zilog's new 32-bit microprocessor” online. Retrieved from: https://www.computer.org/csdl/proceedings/afips/1984/5091/00/50910083.pdf 239 words

Permalink | Show parent | Reply

Re: Unit 6 Discussion Assignment by Benjamin Silverio Tubbs - Monday, 11 March 2019, 1:04 PM Thank you very much for the feedback! 7 words

Permalink | Show parent | Reply

https://my.uopeople.edu/mod/forum/discuss.php?d=191797

5/22

3/12/2019

CS 1104 - AY2019-T3: Unit 6 Discussion Assignment

Re: Unit 6 Discussion Assignment by Mantaj Dura - Sunday, 10 March 2019, 10:35 PM While composing any code, the framework changes the Java programming language to machine level language with the goal that the PC will most likely comprehend it. Moreover, while building another PC framework likewise we need a machine language which will almost certainly offer guidance to the PC to perform different tasks. The Hack language does likewise and it utilizes two kinds of guidance i.e., an address instruction(A - guidance) and a compute instruction(C - instruction)(N. Nisan and S. Schocken, 2008). We additionally realize that the A register can be utilized to encourage direct access to the memory. M is simply the area of memory which is tended to by A. The A register chooses memory for a progressive C - instruction including M or memory for a progressive C - instruction including a bounce and it prompts the clashing utilization of the A register. Thus, to maintain a strategic distance from this confliction, in elegantly composed projects a C-instruction that may cause a hop ought not to contain a reference to M, and vice versa(N. Nisan and S. Schocken, 2008). There is a device joined to a PC or from a program with a signal in a PC which needs a working framework so it advises the PC to do what and that signal is known as the interrupt. The most part of the PCs is driven by an interrupt. The programs in the PC continue running until and unless an interrupt is detected and afterward the PC chose what to do next(Rouse, 2016).

References: Rouse, M. (2016, December). What is interrupt? - Definition from WhatIs.com. Retrieved December 24, 2018, from https://whatis.techtarget.com/definition/interrupt Undefined, U. U. (2008). Machine Language. In N. Nisan & S. Schocken (Authors), The elements of computing systems: Building a modern computer from first principles. Cambridge, MA: MIT Press. 306 words

Rate: Rate...

Permalink | Show parent | Reply

Re: Unit 6 Discussion Assignment by Onyekwere Oluoha (Instructor) - Tuesday, 12 March 2019, 5:34 AM Hello Mantaj /Class,

https://my.uopeople.edu/mod/forum/discuss.php?d=191797

6/22

3/12/2019

- AY2019-T3: Unit 6 Discussion Assignment You made a good attemptCSat1104 answering the question, although you overlooked some critical information. Kindly note that an interrupts could simply be described as external events (in relation to the currently executing process in the CPU), which brings about a change in normal flow of control in the CPU (University of Toronto, 2006). In other words, interrupts are external events that break the sequence of instruction execution in the CPU. Interrupts could be triggered by an external hardware (called hardware interrupts) such as input/output devices or by user programs (called software interrupts) for instance, while attempting to execute illegal machine instruction or in an arithmetic overflow (Brooklyn College, 2003). Interrupts are typically raised when a device needs some kind of service.

A CPU can be made to know when devices need some service by pooling (periodic checks to know if a device needs service), or by giving each device a wire, which is sometimes called interrupt lines (Rebeiro C., n.d.), which can then be used to signal the processor. When the CPU receives an interrupt signal, it immediately halts its current process and executes a routine called an interrupt service routine or interrupt handler (Dandamudi, n.d.), which helps it handle the current interrupt. Once the interrupt is handled, the CPU resumes execution of original program that was placed on hold. To illustrate, an interrupt is like picking your mobile phone only when it rings/beeps, while the pooling system is akin to checking your phone every now and then for notifications or calls. An apparent advantage of using interrupts to signal the CPU rather than the pooling system is that interrupts tend to eliminate overheads (especially when such events are infrequent). However, in some specific applications, the pooling system may be desired.

OLuOHA.

References Brooklyn College (2003) “Computer system overview” online. Retrieved from: http://www.sci.brooklyn.cuny.edu/~jniu/teaching/csc33200/files/0910ComputerSystemOverview02.pdf

https://my.uopeople.edu/mod/forum/discuss.php?d=191797

7/22

3/12/2019

CS 1104 - AY2019-T3: Unit 6 Discussion Assignment Dandamudi S. (n.d.) “Interrupts” online. In Fundamentals of Computer Organization and Design Retrieved from: http://service.scs.carleton.ca/sivarama/org_book/org_book_web/slides/chap_1_v

Rebeiro D. (n.d.) “Interrupts, Exceptions, and System Calls” online. Retrieved from: http://www.cse.iitm.ac.in/~chester/courses/15o_os/slides/5_Interrupts.pdf University of Toronto (2006) “Interrupts” online. Retrieved from:

http://www.cs.toronto.edu/~demke/469F.06/Lectures/Lecture6.pdf

400 words

Permalink | Show parent | Reply Re: Unit 6 Discussion Assignment by Isaiah Scott - Monday, 11 March 2019, 5:54 AM In the description of the Hack machine language in chapter 4, it is stated that in well-written programs, a C-instruction that may cause a jump should not contain a reference to M, and vice versa. Discuss why this should be avoided. The general reason a C-instruction that may cause a jump should not contain a reference to M and vice versa is to prevent conflicting use of the A register. In Programming, the C- instruction is what gets almost everything done. As an instruction code, it is tasked with handling 3 questions: (a) what to compute, (b) where to store the computed value, and (c)what to do next? These specifications, as well as the A-instruction determine every possible operation a computer can make.

In the above image, the leftmost bit is the C-instruction code, which is currently 1. The next two bits go unused. The remaining ones form three fields that correspond to the three parts of the instruction’s symbolic representation. The symbolic instruction dest = comp;jump is as follows: The comp field gives instructions to the ALU on what to compute and the dest field instructs where the computed value is to be stored. The jump field specifies a jump condition, which command to fetch and execute next.

https://my.uopeople.edu/mod/forum/discuss.php?d=191797

8/22

3/12/2019

CS 1104 - AY2019-T3: Unit 6 Discussion Assignment The Hack ALU computes a fixed set of functions on the following registers, D, A, and M; where M stands for Memory[A]. The computed function contains an a-bit and six c-bits comprising the instruction's comp field. The 7-bit pattern has the potential to code up to 128 different functions.

The value of the C-instruction can be stored within several destinations. The value is computed by the comp part of the C-instruction and the destination is specified by the instruction's 3-bit dest part. The first two d-bits code whether to store the computed value in the D and A registers, respectively. The third d-bit codes whether to store the value in M. One, multiple, or none of these bits may be asserted. The first instruction makes the computer select the memory register whose address is 7. It is known as the M register. The second instruction computes the value of M+1 and stores the results in both M and D.

https://my.uopeople.edu/mod/forum/discuss.php?d=191797

9/22

3/12/2019

CS 1104 - AY2019-T3: Unit 6 Discussion Assignment The jump field tells the computer what to do next. The computer has the option to either fetch and execute the next instruction in the program or it can fetch and execute an instruction located elsewhere in the program. In the latter case, we assume that the A register has been previously set to the address to which we have to jump. The three j- bits determine whether a jump is materialized or not. The first j-bit determines whether to jump in case this value is negative. The second is for the case of the value being zero. The third is for the value being positive.

There are some conflicting uses of the A register that can occur using these methods. The programmer can have the A register be used to select either a data memory location for a subsequent C-instruction involving M, or an instruction memory location for a subsequent C-instruction involving a jump. This is why to prevent conflicting use of the A register, in well-written programs a C-instruction that may cause a jump (i.e., with some non-zero j bits) should not contain a reference to M, and vice versa. Research the concept of interrupts in a computer. You may want to look into how the Z80 microprocessor handles interrupts. A good source of Z80 information is the Rodnay Zaks book, "How to Program the Z80." In computers, an interrupt is a signal from a device attached to a computer or program that requires he operating system, OS, to stop, or become interrupted, to figure out what to do next. Almost all computers in today's day in age are interruptdriven. This means

https://my.uopeople.edu/mod/forum/discuss.php?d=191797

10/22

3/12/2019

- AY2019-T3: Unit 6 Discussion Assignment that they start down the list CS of 1104 instructions in one program and continue to run the instructions until either they run out of instructions or an interrupt signal is sensed.

A single computer can only perform a single interaction at at time, but because it c...


Similar Free PDFs