Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with these computer science questions dealing with cpu and assembly language 3. We can also use masking to examine or set a particular

Need help with these computer science questions dealing with cpu and assembly language image text in transcribed
image text in transcribed
3. We can also use masking to examine or set a particular bit in a memory location or register. This involves using the logical op- erations AND and OR, one of whose operands is the memory loca- tion/register and the other is a binary mask, a string as long as the memory location/register. Given this information: (a) Describe how you would clear a particular bit, say 4, in register o, leaving all other bits alone; i.e., what is the logical operation, and what would the mask look like? (b) Show how you would do this in the PC's assembly language (c) Describe how you would set bit 4 in register o, leaving all other bits alone. (d) Show how you would do this in the PC's assembly language. 4. In addition to the logical operations AND and OR, which if any of the following could you also use for masking? Explain your answers. (a) XOR (b) NAND (c) NOR 5. Suppose you are a CPU designer, and Pixar asks you to design a new special-purpose CPU for rendering (i.e, drawing) frames of their computer-animated movies. Would you give them a RISC or a CISC CPU? Why? 6. When an interrupt occurs, a CPU's registers are saved by the hard- ware itself to a particular place in memory, usually the stack. The CPU then executes instructions necessary to handle the interrupt. After the interrupt is handled, the values of the registers are re- stored by the hardware. How does the CPU know where (i.e, at which memory address) to resume the program it was working on before the interrupt? 7. Suppose you are designing a C that will have 130 instructions (a) How many bits are needed for the op code in each instruction? (b) Is this wasteful? If not, why not? If so, what might you do to avoid the waste? 3. We can also use masking to examine or set a particular bit in a memory location or register. This involves using the logical op- erations AND and OR, one of whose operands is the memory loca- tion/register and the other is a binary mask, a string as long as the memory location/register. Given this information: (a) Describe how you would clear a particular bit, say 4, in register o, leaving all other bits alone; i.e., what is the logical operation, and what would the mask look like? (b) Show how you would do this in the PC's assembly language (c) Describe how you would set bit 4 in register o, leaving all other bits alone. (d) Show how you would do this in the PC's assembly language. 4. In addition to the logical operations AND and OR, which if any of the following could you also use for masking? Explain your answers. (a) XOR (b) NAND (c) NOR 5. Suppose you are a CPU designer, and Pixar asks you to design a new special-purpose CPU for rendering (i.e, drawing) frames of their computer-animated movies. Would you give them a RISC or a CISC CPU? Why? 6. When an interrupt occurs, a CPU's registers are saved by the hard- ware itself to a particular place in memory, usually the stack. The CPU then executes instructions necessary to handle the interrupt. After the interrupt is handled, the values of the registers are re- stored by the hardware. How does the CPU know where (i.e, at which memory address) to resume the program it was working on before the interrupt? 7. Suppose you are designing a C that will have 130 instructions (a) How many bits are needed for the op code in each instruction? (b) Is this wasteful? If not, why not? If so, what might you do to avoid the waste

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

64 Incident and emergency response plans.

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago