Computer Science: An Overview (12th Edition)
Computer Science: An Overview (12th Edition)
12th Edition
ISBN: 9780133760064
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
Question
Book Icon
Chapter 2, Problem 36CRP

a.

Program Plan Intro

Program plan:

  • Initialize the variable “bit_pattern1” as “00000000”.
  • Initialize the variable “bit_pattern2” as “11110000” which is the mask value.
  • Perform logical “OR” operation between the value of the variables “bit_pattern1” and “bit_pattern2” to display “1’s” in upper 4-bits, store the resultant value in the variable “result”.
  • Print the result.

b.

Program Plan Intro

Program plan:

  • Initialize the variable “bit_pattern1” as “00000000”.
  • Initialize the variable “bit_pattern2” as “10000000” which is the mask value.
  • Perform logical “XOR” operation between the value of the variables “bit_pattern1” and “bit_pattern2” to find complement of most significant bit in pattern, store the resultant value in the variable “result”.
  • Print the result.

c.

Program Plan Intro

Program plan:

  • Initialize the variable “bit_pattern1” as “00000000”.
  • Initialize the variable “bit_pattern2” as “11111111” which is the mask value.
  • Perform logical “XOR” operation between the value of the variables “bit_pattern1” and “bit_pattern2” to find complement of 8-bits pattern, store the resultant value in the variable “result”.
  • Print the result.

d.

Program Plan Intro

Program plan:

  • Initialize the variable “bit_pattern1” as “00000000”.
  • Initialize the variable “bit_pattern2” as “01111111” which is the mask value.
  • Perform logical “AND” operation between the value of the variables “bit_pattern1” and “bit_pattern2” to find “0” in least significant bit, store the resultant value in the variable “result”.
  • Print the result.

e.

Program Plan Intro

Program plan:

  • Initialize the variable “bit_pattern1” as “00000000”.
  • Initialize the variable “bit_pattern2” as “01111111” which is the mask value.
  • Perform logical “OR” operation between the value of the variables “bit_pattern1” and “bit_pattern2” to find “1” in all bits except the most significant bit, store the resultant value in the variable “result”.
  • Print the result.

f.

Program Plan Intro

Program plan:

  • Initialize the variable “bit_pattern1” as “111111111111111111111111”.
  • Initialize the variable “bit_pattern2” as “111111111111111111111111” which is the mask value.
  • Perform logical “XOR” operation between the value of the variables “bit_pattern1” and “bit_pattern2” to find change the color to black, store the resultant value in the variable “result1”.
  • Initialize anremaining variable “bit_pattern3” as “111111110000000011111111” which is the mask value to filter all the green components.
  • Perform logical “OR” operation between the value of the variables “result1” and “bit_pattern3” to filter out all green color components, store the resultant value in the variable “result2”.
  • Print the result.

g.

Program Plan Intro

Program plan:

  • Initialize the variable “bit_pattern1” as “111111111111111111111111”.
  • Initialize the variable “bit_pattern2” as “111111111111111111111111” which is the mask value.
  • Perform logical “XOR” operation between the value of the variables “bit_pattern1” and “bit_pattern2” to invert all bits, store the resultant value in the variable “result”.
  • Print the result.

h.

Program Plan Intro

Program plan:

  • Initialize the variable “bit_pattern1” as “111111111111111111111111”.
  • Initialize the variable “bit_pattern2” as “000000000000000000000000” which is the mask value.
  • Perform logical “XOR” operation between the value of the variables “bit_pattern1” and “bit_pattern2” to invert all bits, store the resultant value in the variable “result”.
  • Print the result.

Blurred answer
Students have asked these similar questions
14. For this question, mark all answers that apply. Assuming that i, j, and k are all 32-bit int and a, b, and c are all normal 32-bit float, and that no values go out of range, which of the following must be true? a* (b*c) = (a*b)*c If a>0 and b>0, then (a+b) >a i+(j+k) i*(j*k) (i+j)+k == == == (i+j)+k (i*j)*k k+(j+i)
7. A pair of 7-bit floating point formats, based on the IEEE standard, is described below: • Format (a) has k = 3 and n = 4. The exponent bias is 3. Format (b) has k = 4 and n = 3. The exponent bias is 7. (a) Convert the bit patterns below, given in format (a) to bit patterns in format (b). Convert exact values when possible, otherwise use the round-to-even rule. Also, write the values of each bit pattern, for the (a) and (b) formats. Write the values, in decimal, as rational numbers, or whole integers. Bits (a) Value Bits (b) Value 1 0111 000 011 0000 101 1010 110 1011 000 0011 1 (b) What is the smallest positive denormalized number in format (b)? What is the largest positive denormalized number in format (b)?
1. two digits 8 & 3, Convert it to a 7-bit binary number (83 → 0010111) 3. Do the analysis of state-tape contents as in diagram (*) in ex.1 for a task of generating parity bit for the number. For the example, initial tape contents should be ΦΦ0010111Φ, and the parity bit is then 0 → final contents on the tape is Φ00010111Φ

Chapter 2 Solutions

Computer Science: An Overview (12th Edition)

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
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education