C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 2.5, Problem 10E
a)
Program Plan Intro
To fill the values of given characters in the memory diagram.
b)
Program Plan Intro
To fill the values of given characters in the memory diagram.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
(B+C) x (D+E)
F
1. Write code to implement the expression: A =
on 3-, 2-, 1- and 0-address
machines. In accordance with programming language practice, computing the expression should
not change the values of its operands.
2. Solve the following:
a) In a computer instruction format, the instruction length is 11 bits and the size of an address
field is 4 bits. Is it possible to have:
5 2-address instructions, 45 1-address instructions and 32 0-address instructions using the spec-
ified format? Justify your answer.
3. Suppose a computer using direct mapped cache has 232 bytes of byte-addressable main memory
and a cache size of 512 bytes, and each cache block contains 128 bytes.
a) How many blocks of main memory are there?
b) What is the format of a memory address as seen by cache, i.e., what are the sizes of the tag,
block, and offset fields?
c) To which cache block will the memory address 0x13A4498A map?
[1] ( Show your work. Show hoe you compute memory address by using the effective memory
address computation.
Assume the following values are stored at the indicated memory addresses and
registers:
Address Value
0x100
OxFF
0x104
OxAB
0x108
0x13
0x10c
0x11
$0x108
(Zrax)
Fill in the following table showing the values for the indicated operands:
Operand
Value
Zrax
0x104
4(%rax)
9(%rax, Xrdx)
Register
Zrax
Zrcx
%rdx
260(Xrcx,Xrdx)
OxFC(Zrcx, 4)
(Zrax, Xrdx, 4)
Value
0x100
0x1
0x3
(d) You are working on a redesign of a simple 16-bit computer which
supports at most 64 kilobytes of memory. Currently, memory is
word-addressed and all memory accesses load or store a 16-bit
value. For example,
LDA Ox6502
loads a 16-bit value from address Ox6502 into register A. The
change is to support additionally 8-bit accesses, thanks to an
expanded machine language (already designed by a colleague)
which now supports instructions such as:
; load 16 bits from addr 6502 into A
; load 8 bits from addr 6502 into A
LDAW Ox6502
LDAB Ox6502
Outline, at a high level, how you would bring about this change in
the CPU design, and mentioning any difficulties you expect to
encounter.
Chapter 2 Solutions
C++ for Engineers and Scientists
Ch. 2.1 - (Practice) State whether the following are valid...Ch. 2.1 - Prob. 2ECh. 2.1 - Prob. 3ECh. 2.1 - (Practice) Determine names for functions that do...Ch. 2.1 - (Program) a. Using cout, write a C++ program that...Ch. 2.1 - (Program) a. Write a C++ program to display the...Ch. 2.1 - (Program) a. How many cout statements would you...Ch. 2.1 - (Program) a. Assuming your compiler isn’t case...Ch. 2.1 - (Practice) You’re given the task of wiring and...Ch. 2.1 - (Practice) You’re given the job of preparing a...
Ch. 2.1 - (Practice) You’re a sophomore in college and are...Ch. 2.1 - (Practice) You’re given the job of planting a...Ch. 2.1 - (Practice) You’re responsible for planning and...Ch. 2.1 - (Data processing) a. A national medical testing...Ch. 2.2 - (Debug) a. Will the following program work?...Ch. 2.2 - (Modify) Rewrite the following programs to conform...Ch. 2.2 - (For thought) a. When used in a message, the...Ch. 2.2 - (For thought) a. A token of a computer language is...Ch. 2.3 - (Practice) Determine data types appropriate for...Ch. 2.3 - (Practice) Compile and run Program 2.5.Ch. 2.3 - Prob. 3ECh. 2.3 - (Practice) Show how the name KINGSLEY is stored in...Ch. 2.3 - Prob. 5ECh. 2.3 - Prob. 6ECh. 2.3 - Prob. 7ECh. 2.3 - (For thought) Although you have concentrated on...Ch. 2.3 - (Practice) Although the total number of bytes...Ch. 2.4 - (Practice) For the following correct algebraic...Ch. 2.4 - (Practice) Determine the values of the following...Ch. 2.4 - (Practice) Determine the value of the following...Ch. 2.4 - (Practice) Evaluate the following mixed-mode...Ch. 2.4 - Prob. 5ECh. 2.4 - Prob. 6ECh. 2.4 - Prob. 7ECh. 2.4 - Prob. 8ECh. 2.4 - Prob. 9ECh. 2.4 - (Program) Write a C++ program that displays the...Ch. 2.4 - Prob. 11ECh. 2.5 - (Practice) State whether the following variable...Ch. 2.5 - Prob. 2ECh. 2.5 - (Practice) a. Write a declaration statement to...Ch. 2.5 - Prob. 4ECh. 2.5 - Prob. 5ECh. 2.5 - Prob. 6ECh. 2.5 - Prob. 7ECh. 2.5 - Prob. 8ECh. 2.5 - (Practice) a. Using Figure 2.14 and assuming the...Ch. 2.5 - Prob. 10ECh. 2.5 - Prob. 11ECh. 2.6 - (Modify) a. Modify Program 2.11 to calculate the...Ch. 2.6 - (Modify) a. Modify Program 2.11 to determine the...Ch. 2.6 - Prob. 3ECh. 2.6 - Prob. 4ECh. 2.6 - (Conversion) a. Design, write, compile, and run a...Ch. 2.6 - (Hydraulics) a. Write, compile, and run a C++...Ch. 2.6 - (Thermodynamics) a. Design, write, compile, and...Ch. 2.6 - Prob. 8ECh. 2 - (General math) a. Design, write, compile, and run...Ch. 2 - (General math) a. Design, write, compile, and run...Ch. 2 - (Physics) a. Design, write, compile, and run a C++...Ch. 2 - Prob. 4PPCh. 2 - (Hydraulics) a. Design, write, compile, and run a...Ch. 2 - Prob. 6PPCh. 2 - (Physics) a. The weight of an object on Earth is a...Ch. 2 - (Modify) a. Modify the program you wrote for...Ch. 2 - (Civil eng.) The maximum load that can be placed...Ch. 2 - (Civil eng.) Modify the program written for...Ch. 2 - (Mechanical eng.) The minimum radius required for...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- (iv) How many bytes in memory will be required to store 10 integers and 6 boolean variables.arrow_forward(Amdahl’s law question) Suppose you have a machine which executes a programconsisting of 50% floating point multiply, 20% floating point divide, and the remaining 30% are fromother instructions.(a) Management wants the machine to run 4 times faster. You can make the divide run at most 3 timesfaster and the multiply run at most 8 times faster. Can you meet management’s goal by making onlyone improvement, and which one?arrow_forward[no. 21] What does the // operator in Python allow you to do? a. Perform floating point division b. Perform operations on exponents c. Find the remainder of a division operation d. Perform integer divisionarrow_forward
- I need the correct answer. Don't give wrong.arrow_forward(Computer Organization and Design)arrow_forward1. (30%) Write LC-3 machine code routines for the followings: (a) To perform an OR on two binary numbers stored in x3100 and x3101. Store the result at x3102. (b) To perform an XOR on two binary numbers stored in x3100 and x3101. Store the result at x3102.arrow_forward
- 4. (16 pts.) Pseudoinstructions are not part of the MIPS instruction set but often appear in MIPS programs. For each pseudoinstruction in the following table, produce a minimal sequence of actual MIPS instructions to accomplish the same thing. You may need to use Sat for some of the sequences. In the following table, "imm" refers to a specific number that requires 32 bits to represent. Pseoduinstructions move $t1, $12 clear Sto beq St1, imm, L bge $15, $13, L What it accomplishes $t1 = $12 $t0=0 == If ($t1 big) go to L If ($t5 >= $13) go to Larrow_forwardc. (3 Pts) In a certain computer architecture, the content of some registers and memory content currently is as follows. Memory Address Data R1 | 00000004 0000FFFE FO00128A R2 0000FFFE FO00128A 0000FFF0 Next, this computer execute the following instruction. ADDI (0000FFFE), R1 Note: The I in ADDI refers to Indirect. Indirect here deals with the destination address: (0000FFFE). The parentheses are standard for indirect addressing. ADDI means add content of source to content of destination and place result in destination. Given that it is immediately after the instruction above is executed, fill out the contents of registers and memory addresses below. Memory Address Data R1 0000FFFE R2 FO00128Aarrow_forward[1] ( Show your work. Show hoe you compute memory address by using the effective memory address computation. Assume the following values are stored at the indicated memory addresses and registers: Address Value 0x100 OxFF 0x104 OxAB 0x108 0x13 0x10c 0x11 Register %rax %rcx %rdx $0x108 (%rax) 4(%rax) 9(%rax, %rdx) 260(%rcx,%rdx) OxFC (,%rcx, 4) (%rax, %rdx, 4) Value 0x100 0x1 0x3 Fill in the following table showing the values for the indicated operands: Operand Value %rax 0x104arrow_forward
- 3. (15 pts.) Consider the following fragment of C code: for (i=0; i<=100; i=i+1) a [i] = b[i] + c; Assume that a and b are arrays of words and that the base address of a is in $a0 and the base address of b is in $a1. Register $t0 is associated with variable I and register $50 with the value of c. You may also assume that any address constants you need are available to be loaded from memory. (1) (10 pts.) Write the code for MIPS. (2) (5 pts.) How many instructions are executed during the running of this code if there are no array out-of-bounds exceptions thrown? (3) How many memory data references will be made during execution?arrow_forward(C PROGRAMMING ONLY) 3. How Much Is The House?by CodeChum Admin There's this house I want to buy just right around the corner. I know its address but I don't know its value. Can you please help me determine it? Instructions: In the code editor, you are provided with an initial code which has main() function.In the main(), the user is asked for an integer input and then its address is assigned to a pointer variable (see line 9)Your task is to print the value of the pointer variable using the dereferencing operator.Input 1. An integer Output Enter n: 5Value of *ptr = 5arrow_forward(Subject: MATLAB) Hello dear, l need to answer in a short time, less than an hour.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Computer Fundamentals - Basics for Beginners; Author: Geek's Lesson;https://www.youtube.com/watch?v=eEo_aacpwCw;License: Standard YouTube License, CC-BY