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
Q1. Write an ALP to read the memory location 1234H to read two-digit number and check bit B-3 and B-
7 and store the following resulting value at memory location 2000H onwards.
B-
B-
Memory Location
7
3
2000H
ZER
ONE
1
TWO
1
1
THRE
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 program to count the number of l's in an 8-bit pattern and store it in memory
at XX50 H. Also store the position of each 1 in memory locations starting at XX51 H.
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
- Given the following decimal numbers, convert the numbers to a 16-bit memory location in binary using two's complement. (show all details step by step) 165910 - 165910 954610 - 954610 Convert the following decimal numbers to binary using the two’s complement format, using 8 bits: 4810 -3910 -28410 010 Briefly explain why two’s complement is the best format for representing signed integers in a computer. 4. Convert the following decimal numbers to binary floating-point representation, using 4 bits for the fractional part: 68.510 125.4410 99.9910 give the answer of everything otherwise dont give. pleasearrow_forwardWrite 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,33harrow_forward2. For a computer that uses 9-bit word size and Signed Magnitude (SM) arithmetic to represent numbers, show how 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
- 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
- Create a MIPS programme that calculates the Hamming ECC code for an 8-bit byte. 8-bit positive numbers are easier to work with than larger ones, so your codes function for them. The programme requests a byte of data (a positive number from 0 to 255 in decimal) and creates the 12-bit Hamming code. The programme then outputs hex with a label.arrow_forward5. Suppose we want an error-correcting code that will allow all single-bit errors to be corrected for memory words of length 10. a. How many parity bits are necessary? b. Assuming we are using the Hamming algorithm presented in this chapter to design our error-correcting code and an odd parity, find the code word to present the 10-bit information word: 1 0 0 1 1 0 0 1 1 1arrow_forward1. In a binary coded decimal (BCD) system, 4 bits are used to represent a decimal digit from 0 to 9. For example, 3710 is written as 00110111BCD. (a) Write 28910 in BCD (b) Convert 100101010001BCD to decimal (c) Convert 01101001BCD to binary (d) Explain why BCD might be a useful way to represent numbersarrow_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_forward5. Suppose we want an error-correcting code that will allow all single-bit errors to be corrected for memory words of length 10. a. How many parity bits are necessary? b. Assuming we are using the Hamming algorithm presented in this chapter to design our error-correcting code and an odd parity, find the code word to present the 10-bit information word: C. 1 0 0 1 1 0 0 1 1 1 We now receive the following code word: 1 0 1 0 1 1 0 0 0 0 1 0 1 1 Is this a legal code word, assuming an odd parity? If not, what is the corrected code word? (Which bit is the error bit?)arrow_forwardSuppose we want an error-correcting code that will allow all single-bit errors to be corrected for memory words of length 10. 1. a) How many parity bits are necessary? 2. b) Assuming we are using the Hamming algorithm presented in this chapter to design our error-correcting code, find the code word to represent the 10-bit information word: 1 0 0 1 1 0 0 1 1 0.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