Computer Science: An Overview (12th Edition)
12th Edition
ISBN: 9780133760064
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 2, Problem 33CRP
a.
Program Plan Intro
Program plan:
- LOAD the bit pattern in memory location “0x44” to a register.
- STORE the value in the register to a memory location “0xAA”.
- HALT the
program.
b.
Program Plan Intro
Program plan:
- LOAD the content of memory location “0x34” into a register.
- LOAD the memory location “0xF0” to another register.
- AND the bit pattern of registers, store the result in another register.
- STORE back the value of AND operation to memory location “0x34”.
- HALT the program.
c.
Program Plan Intro
Program plan:
- LOAD the content of memory location “0xA5” into a register “2”.
- LOAD the memory location “0x0F” to another register “3”.
- AND the bit patterns of registers, store the result in register “4”.
- LOAD the content of memory location “0xA6” into a register “5”.
- LOAD the memory location “0xF0” to register “6”.
- AND the bit patterns of register “5” and “6”, store the result in register “7”.
- OR the bit patterns of register “7” and “4”, store the result in register “8”.
- STORE back the value OR operation to memory location “0xA6”.
- HALT the program.
d.
Program Plan Intro
Program plan:
- LOAD the content of memory location “0xA5” into a register “2”.
- LOAD the memory location “0x0F” to another register “3”.
- AND the bit patterns of registers, store the result in register “4”.
- LOAD the memory location “0xF0” to register “5”.
- AND the bit patterns of register “2” and “5”, store the result in register “6”.
- ROTATE the bit pattern in register “6” through four times.
- OR the bit patterns of register “6” and “4”, store the result in register “7”.
- STORE back the value OR operation to memory location “0xA5”.
- HALT the program.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Don't give wrong answer.
Write a program that will:
a. Create an array of bytes containing the values: 12h, 34h, 56h, 78h, 9Ah, BCh, DEh, F0h
b. Loop over the array and compute the sum in the EAX register. Note: the array contains bytes and you convert the bytes in the array to a 32-bit value before performing the sum.
c. Show the contents of the EAX and ECX register at each iteration of the loop.
Write a sequence of instructions that shift three memory bytes to the right by 1 bit position.Use the following test data:byteArray BYTE 81h,20h,33h
Chapter 2 Solutions
Computer Science: An Overview (12th Edition)
Ch. 2.1 - What sequence of events do you think would be...Ch. 2.1 - What information must the CPU supply to the main...Ch. 2.1 - Prob. 3QECh. 2.2 - Prob. 1QECh. 2.2 - In the text, JUMP instructions were expressed by...Ch. 2.2 - Is the instruction If 0 equals 0, then jump to...Ch. 2.2 - Write the example program in Figure 2.7 in actual...Ch. 2.2 - The following are instructions written in Vole...Ch. 2.2 - What is the difference between the instructions...Ch. 2.2 - Here are some instructions in English. Translate...
Ch. 2.3 - Prob. 1QECh. 2.3 - Suppose the Vole memory cells at addresses 0xB0 to...Ch. 2.3 - Suppose the Vole memory cells at addresses 0xA4 to...Ch. 2.3 - Suppose the Vole memory cells at addresses 0xF0 to...Ch. 2.4 - Prob. 1QECh. 2.4 - Prob. 2QECh. 2.4 - Prob. 3QECh. 2.4 - a. Suppose you XOR the first 2 bits of a string of...Ch. 2.4 - Prob. 5QECh. 2.4 - Prob. 6QECh. 2.4 - Prob. 7QECh. 2.4 - Prob. 8QECh. 2.4 - Prob. 9QECh. 2.4 - Prob. 10QECh. 2.4 - Using Vole machine language (Appendix C), write a...Ch. 2.4 - Prob. 12QECh. 2.5 - Prob. 1QECh. 2.5 - Prob. 2QECh. 2.5 - Prob. 3QECh. 2.6 - The hypotenuse example script truncates the sides...Ch. 2.6 - Prob. 2QECh. 2.6 - The Python built-in function str () will convert a...Ch. 2.6 - Use the Python built-in bin () to write a script...Ch. 2.6 - Prob. 6QECh. 2.7 - Referring back to Questions 3 of Section 2.3, if...Ch. 2.7 - Prob. 2QECh. 2.7 - Suppose there were two central processing units...Ch. 2 - a. In what way are general-purpose registers and...Ch. 2 - Answer the following questions in Vole machine...Ch. 2 - Prob. 3CRPCh. 2 - What is the value of the program counter in the...Ch. 2 - Prob. 5CRPCh. 2 - Prob. 6CRPCh. 2 - Prob. 7CRPCh. 2 - Suppose a machine language is designed with an...Ch. 2 - Translate the following instructions from English...Ch. 2 - Rewrite the program in Figure 2.7 assuming that...Ch. 2 - 11. Classify each of the following instructions...Ch. 2 - Prob. 12CRPCh. 2 - Prob. 13CRPCh. 2 - Suppose the memory cells at addresses 0x00 through...Ch. 2 - Suppose the memory cells at addresses 0x00 through...Ch. 2 - Suppose the memory cells at addresses 0x00 through...Ch. 2 - Suppose the memory cells at addresses 0x00 through...Ch. 2 - Prob. 18CRPCh. 2 - If the Vole executes an instruction every...Ch. 2 - Prob. 20CRPCh. 2 - Prob. 21CRPCh. 2 - Prob. 22CRPCh. 2 - Prob. 23CRPCh. 2 - Write a program in Vole to compute the sum of...Ch. 2 - Prob. 26CRPCh. 2 - Prob. 27CRPCh. 2 - Suppose the following program, written in Vole, is...Ch. 2 - Summarize the steps involved when the Vole...Ch. 2 - Summarize the steps involved when the Vole...Ch. 2 - Summarize the steps involved when the Vole...Ch. 2 - Suppose the registers 0x4 and 0x5 in the Vole...Ch. 2 - Prob. 33CRPCh. 2 - Prob. 34CRPCh. 2 - Prob. 35CRPCh. 2 - Prob. 36CRPCh. 2 - Prob. 37CRPCh. 2 - Prob. 38CRPCh. 2 - Prob. 39CRPCh. 2 - Prob. 40CRPCh. 2 - Prob. 41CRPCh. 2 - Prob. 42CRPCh. 2 - a. What single instruction in the Vole machine...Ch. 2 - Write a Vole program that reverses the contents of...Ch. 2 - Write a Vole program that subtracts the value...Ch. 2 - Prob. 46CRPCh. 2 - Suppose a person is typing forty words per minute...Ch. 2 - Prob. 48CRPCh. 2 - Suppose the Vole communicates with a printer using...Ch. 2 - Write a Vole program that places 0s in all the...Ch. 2 - Prob. 51CRPCh. 2 - Prob. 52CRPCh. 2 - Suppose you are given 32 processors, each capable...Ch. 2 - Prob. 54CRPCh. 2 - Prob. 55CRPCh. 2 - Describe how the average of a collection of...Ch. 2 - Write and test a Python script that reads in a...Ch. 2 - Write and test a Python script that reads in a...Ch. 2 - Prob. 59CRPCh. 2 - Suppose a computer manufacturer develops a new...Ch. 2 - Prob. 2SICh. 2 - Prob. 3SICh. 2 - Prob. 4SICh. 2 - Suppose a manufacturer produces a computer chip...Ch. 2 - Prob. 6SICh. 2 - Prob. 7SICh. 2 - Prob. 8SI
Knowledge Booster
Similar questions
- Assume th at we have a computer with a cache memory of 512 blocks with a total size of 128K bits. Knowing that the computer uses a word addressable mode and the format of the memory address as seen by the Fully associative cache scheme is as shown below, an swer the below question s: Fully Associative Cache Format 19 1- How many words do we have in each cache block? 2- What is the size of each word? 3- What is the size of the main memory? 4- How many blocks are there in the main memory? 5- Draw the format of the memory address as seen by the Direct Mapped Cache scheme, showing the fields as well as their sizes.arrow_forwardCalculate the parity of a byte with the value 31ten and show the pattern stored to memory. Assume the parity bit is on the right. Suppose the most signifi cant bit was inverted in memory, and then you read it back. Did you detect the error? What happens if the two most signifi cant bits are inverted?arrow_forwardAssume that a mad scientist designed a new floating point binary format. In his design, he assigned 1 bit for sign, 10 bits for Exponent, 18 bits for fractions. Sign (1bit) Exponent (10 bit) Fraction (18 bit) Now, assume that you want to store -0.076 into this format. Convert -0.076 into above binary floating point format. For fraction part only compute 7 places after the point. (e.g. 0.1001111) To receive full points in this question, show all the detail computation. Paragraph 三Y= Addarrow_forward
- The first two bytes of a 2M x 16 main memory have the following hex values:Byte 0 is FEByte 1 is 01If these bytes hold a 16-bit two's complement integer, what is its actual decimal value if:a. memory is big endian?b. memory is little endian?arrow_forwardWrite an ASM program that evaluates the following expression, using variables:Z = (-A - B) - (-C - D) 1. Declare and initialize the memory variable A to 32-bit signed integer value 543210and variable B to 16-bit signed integer value -3210.2. Declare the memory variables C and D and read in their values from the keyboardas 32-bit signed integer value 43210 and 8-bit signed integer values -10,respectively.a. You should display a message asking for the value of the variable, forexample: “What is the value of C?” thenb. Read in the value of C from the keyboard and thenc. Display the value you have read beside (ie, to the right of) the message“What is the value of C?”. Then repeat for variable D in the next line.3. Variable Z should be declared as a 32-bit signed integer.4. Display the string “Z = (-A - B) - (-C - D)” alone in a single line.5. Display the values of all the variables A, B, C, D together in the next line (in theorder in which they appear in the expression); each separated by…arrow_forwardFor a computer that uses 9-bit word size and Signed Magnitude (SM) arithmetic to represent numbers, showhow this computer will perform the addition of the two decimal numbers (-129) and (-171). You should: a. Find the equivalent SM values of (-129) and (-171). b. Show how this computer will perform the addition of the two numbers. c. Read the result in SM to its equivalent in decimal and state whether the result is correct or not.arrow_forward
- y of H Q. For the given circuit, which of the following is correct? E OF RAM 256 X 4 A. The number 5 is being written to the memory at address location 203. B. The chip has not been enabled, since the EN terminal is 0; therefore, nothing will be written to the chip and the output is tri- 1 A0 1 A1 O A2 O A3 1 A4 A 255 O A5 1 A6 1 A7 71 QO stated. O DO 1 D1 O D2 1 D3 C. Decimal 10 is being written into memory location 211. D. The read/write line is LOW; therefore, WRITE decimal 5 is being stored at memory O R/W O CS READ EN location 211. Data inputs Address inputs DDDD Data outputsarrow_forwardDigital logicarrow_forwardWrite an ASM program that evaluates the following expression, using variables:Z = (A - B) - (C - D)1. Declare and initialize the memory variable A to 32-bit signed integer value -543210and variable B to 16-bit signed integer value -3210.2. Declare the memory variables C and D and read in their values from the keyboardas 32-bit signed integer value -43210 and 8-bit signed integer values -10, respectively.a. You should display a message asking for the value of the variable, for example: “What is the value of C?” then b. Read in the value of C from the keyboard and then c. Display the value you have read beside (ie, to the right of) the message “What is the value of C?”. Then repeat for variable D in the next line.3. Variable Z should be declared as a 32-bit signed integer. 4. Display the string “Z = (A - B) - (C - D)” alone in a single line.5. Display the values of all the variables A, B, C, D together in the next line (in the order in which they appear in the expression); each separated…arrow_forward
- 9. Each of the following pairs of signed (two's complement) integers are stored in computer words (6 bits). Compute the sum as it is stored in a 6-bit computer word. Show the decimal equivalents of each operand and the sum. Indicate if there is overflow. a. 110101 С. 001100 001111 110100 b. 111010 0o0111arrow_forwardC- Write a program to multiply the content of memory location with offset (3000H) with the content of memory location (BA00H). Consider data segment memory.arrow_forwardAssignment for Computer Architecture! this is about hamming codes write the code IN MIPS ASSEMBLY LANGUAGE calculating hamming codes; The key to the Hamming Code is the use of extra parity bits to allow the identification of a single error. Create the code word as follows: Mark all bit positions that are powers of two as parity bits. (positions 1, 2, 4, 8, 16, 32, 64, etc.) All other bit positions are for the data to be encoded. (positions 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, etc.) Each parity bit calculates the parity for some of the bits in the code word. The position of the parity bit determines the sequence of bits that it alternately checks and skips.Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc. (1,3,5,7,9,11,13,15,...)Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc. (2,3,6,7,10,11,14,15,...)Position 4: check 4 bits, skip 4 bits, check 4 bits, skip 4 bits, etc. (4,5,6,7,12,13,14,15,20,21,22,23,...)Position 8: check 8 bits,…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education