Implement the logic circuit in Figure 8.6b using NAND gates only. -f D Tx 8 Ix X4 Ex
Assume that you need to use a single-pole single-throw switch as shown in Figure 7.51a. Show how a counter can be used as a means of de bouncing the Data signal produced by the switch. VDD R www Li X...
Give an algorithm for finding the penultimate (second to last) node in a singly linked list where the last element is indicated by a null next link.
Specify the following queries in relational algebra on the database schema given in Exercise 5.14: a. List the Order# and Ship_date for all orders shipped from Warehouse# W2. b. List the WAREHOUSE...
Describe the output of the following series of stack operations: push(5), push(3), pop(), push(2), push(8), pop(), pop(), push(9), push(1), pop(), push(7), push(6), pop(), pop(), push(4), pop(),...
Suppose an initially empty stack S has performed a total of 25 push operations, 12 top operations, and 10 pop operations, 3 of which generated a StackEmpty exception that was caught and ignored. What...
Let T be an n-node improper binary tree (that is, each internal node has one or two children). Describe how to represent T by means of a proper binary tree T with O(n) nodes.
Show that there are more than 2 n different potentially improper binary trees with n internal nodes, where two trees are considered different if they can be drawn as different looking trees.
Develop a C++ implementation of a priority queue that is based on a heap and supports the locator-based functions.
Suppose you were designing applications for a standard file server environment. One issue discussed in this chapter for this distributed processing environment is that the application software on...
Write a program that creates a String Array List. Continually prompt the user for Strings to add to the list until a sentinel value is entered. Use an iterator to display all the Strings, then...
Write an application that displays every perfect number from 1 through a user-supplied limit. A perfect number is one that equals the sum of all the numbers that divide evenly into it. For example, 6...
In the method header public static boolean(int age), age is a(n) _____. a. Argument b. Parameter c. Return value d. Final value
Which of the following data types can store the value 0 using the least amount of memory? a. Short b. Long c. Int d. Byte
Transform the E-R diagram of Figure 8-23 into a set of 3NF relations. Make up a primary key where needed and one or more nonkey attributes for each entity. Figure 8-23 TOOL ++ Used_on PROJECT Project...
Consider the employee database of Figure 2.17. Give an expression in the relational algebra to express each of the following queries: a. Find the ID and name of each employee who works for BigBank....
Hackers may be able to fool you into believing that their web site is actually a web site (such as a bank or credit card web site) that you trust. This may be done by misleading email, or even by...
Which of the following is not a valid name for an object? a. picMy.Dog b. btnCalcSalesTax c. lbl2019 d. lblProjected2024
Let L be any language. Let us define the transpose of L to be the language of exactly those words that are the words in L spelled backward. If w El, then reverse(w) El. For example, if L = {a abb...
We gave two simple heuristics for the 8-puzzle: Manhattan distance and misplaced tiles. Several heuristics in the literature purport to improve on thissee, for example, Nilsson (1971), Mostow and...
For each of the following agents, specify the sensors, actuators, and environment: microwave oven, chess program, autonomous supply delivery plane.
1. Charlie is a project manager for a new system under development for a national mortgage processing company. A common experience for IS managers today is to lose experienced IS staff members, who...
Write a program that asks the user to enter a distance in kilometers, then converts that distance to miles. The conversion formula is as follows: Miles = Kilometers X 0.6214
What is the difference between computer organization and computer architecture?
Modify the program you wrote for Programming Challenge 13 so it also calculates and displays the amount of money Package A customers would save if they purchased Package B or C, and the amount of...
What is an audit universe and what does it include?
Write a program that creates two ArrayListsone to hold Strings and one to hold Integers. Prompt the user for a word, and while the user does not enter a sentinel value, continue to add each entered...
Write a program that creates an array of at least 20 integers and do the following: Prompt the user for a starting position, and continually reprompts the user for a new value if the starting...
a. Throughout the Case Problems in this course, you have been using a Rental class that obtains all the data for rentals from Sunshine Seashore Supplies, including details about the contract number,...
Write the value relation for the modulus expression.
This question considers Horn KBs, such as the following: P(F(x)) P(x) Q(x) P(F(x)) P(A) Q(B) Let FC be a breadth-first forward-chaining algorithm that repeatedly adds all consequences of currently...
Futoshiki is a Sudoku-like Japanese logic puzzle that is very simple, but can be quite challenging. You are given an n x n grid, and must place the numbers 1, . . . n in the grid such that every row...
Arithlang grammar supports positive integers. Extend this grammar to support negative integers.
Convert the following arithmetic expressions written in infix notation to the prefix notation of Arithlang.
Write a prototype of the Square program, using just one class named SquarePrototype, and using only one method, main. Your program should generate the prescribed border output for the case of when...
In California, whether it rains or not from each day to the next forms a Markov chain (note: this is a terrible model for real weather). However, sometimes California is in a drought and sometimes it...
The sequence number field in the TCP header is 32 bits long, which is big enough to cover over 4 billion bytes of data. Even if this many bytes were never transferred over a single connection, why...
Scientific inquiry investigates the causal relation of variables; scientists study the effects of interventions. Causal networks provide a framework for such analysis by exactly specifying variables...
At sea level, a person has a mass of 175 lbm. Determine the weight of this person in newtons (N).
By the year 2021, the European Union will have a database of fingerprints, photographs for facial recognition, passport numbers and birth dates of all its 350 million citizens. Data that are...
Western Digital, a developer of storage devices and solutions, has grown dramatically since it was established in 1970. Based in San Jose, California, they employ more than 61,000 with locations...
Evergreen Nurseries offers a wide range of lawn and garden products to its customers. Evergreen Nurseries conducts both wholesale and retail operations. Although the company serves as a wholesaler to...
Show the step-by-step multiplication process using Booth algorithm (as in Table 10-3) when the following binary numbers are multiplied. Assume 5-bit registers that hold signed numbers. The...
In the student sample program files for this chapter, you will find a text file named GasPrices.txt. The file contains the weekly average prices for a gallon of gas in the United States, beginning on...
What are the potential problems (perhaps more than one) with the following assembly language code fragment (implementing a subroutine) written to run on MARIE? The subroutine assumes that the...
Describe a representation that could be used in a program to solve analogy problems like that in Figure 7.29. This class of problems was addressed by T. G. Evans (1968). The representation must be...
Assume that $s0 is initialized to 11 and $s1 is initialized to 22. Suppose you executed the code below on a version of the pipeline from Section 4.6 that does not handle data hazards (i.e., the...
A sequential circuit is given in Figure 4-13. Figure 4-13 (a) Add the necessary logic and/or connections to the circuit to provide an asynchronous reset to state A = 1, B = 0 for signal Reset = 0....
For the number sequence {e(k)}, Z E B () = (= + 1) (a) Apply the final-value theorem to E(z). (b) Check your result in part (a) by finding the inverse z-transform of E(z). (c) Repeat parts (a) and...
Calculate the latency (from first bit sent to last bit received) for the following: (a) 10-Mbps Ethernet with a single store-and-forward switch in the path and a packet size of 5000 bits. Assume that...
Which of the following are true? (Choose two.) A. One line needs to be changed for this code to compile. B. Two lines need to be changed for this code to compile. C. Three lines need to be changed...
Open the Electricity Solution.sln file contained in the VB2017\Chap09\Electricity Solution folder. Open the monthlyBills.txt file. Each of the 12 numbers in the file represents the cost of...
In this exercise, you modify the Grade Calculator application from this chapters Apply lesson. Use Windows to make a copy of the Grade Solution folder. Rename the copy Grade Solution-Intermediate....
Assume a program requires the execution of 50 106 FP instructions, 110 106 INT instructions, 80 106 L/S instructions, and 16 106 branch instructions. The CPI for each type of instruction is 1, 1,...
The results of the SPEC CPU 2006 bzip2 benchmark running on an AMD Barcelona has an instruction count of 2.389E12, an execution time of 750 s, and a reference time of 9650 s. 1. Find the CPI if the...
Assume a color display using 8 bits for each of the primary colors (red, green, blue) per pixel and a frame size of 1280 1024. a. What is the minimum size in bytes of the frame buff er to store a...
Another pitfall cited in Section 1.10 is expecting to improve the overall performance of a computer by improving only one aspect of the computer. Consider a computer running a program that requires...
Th e table below shows 32-bit values of an array stored in memory. Address .............Data 24 ..........................2 38 ..........................4 32 ..........................3 36...
Consider the following MIPS loop: 1. Assume that the register $t1 is initialized to the value 10. What is the value in register $s2 assuming $s2 is initially zero? 2. For each of the loops above,...
Translate the following loop into C. Assume that the C-level integer i is held in register $t1, $s2 holds the C-level integer called result, and $s0 holds the base address of the integer MemArray....
What is 4365 - 3412 when these values represent signed 12-bit octal numbers stored in sign-magnitude format? The result should be written in octal. Show your work.
Assume 151 and 214 are signed 8-bit decimal integers stored in twos complement format. Calculate 151 + 214 using saturating arithmetic. The result should be written in decimal. Show your work.
Calculate (3.984375 10 - 1 + 3.4375 10 -1 ) + 1.771 10 3 by hand, assuming each of the values are stored in the 16-bit half precision format described in Exercise 3.27 (and also described in the...
Calculate (3.41796875 10 -3 6.34765625 10 -3 ) 1.05625 10 2 by hand, assuming each of the values are stored in the 16-bit half precision format described in Exercise 3.27 (and also described in...
Give three different examples of a single Java statement that assigns variable, backup, to a new array with copies of all int entries of an existing array, original.
Consider the following loop. Assume that perfect branch prediction is used (no stalls due to control hazards), that there are no delay slots, and that the pipeline has full forwarding support. Also...
This exercise is intended to help you understand the relationship between forwarding, hazard detection, and ISA design. Problems in this exercise refer to the following sequence of instructions, and...
Order the following functions by asymptotic growth rate.
This exercise examines the accuracy of various branch predictors for the following repeating pattern (e.g., in a loop) of branch outcomes: T, NT, T, T, NT 1. What is the accuracy of always-taken and...
Show that n is O(nlogn).
In this exercise we compare the performance of 1-issue and 2-issue processors, taking into account program transformations that can be made to optimize for 2-issue execution. Problems in this...
This exercise explores energy efficiency and its relationship with performance. Problems in this exercise assume the following energy consumption for activity in Instruction memory, Registers, and...
In Section 5.2 we prove by induction that the number of lines printed by a call to drawInterval(c) is 2 c 1. Another interesting question is how many dashes are printed during that process. Prove by...
Describe a recursive algorithmfor computing the n th Harmonic number, defined as H n = n k=1 1/k.
Media applications that play audio or video files are part of a class of workloads called streaming workloads; i.e., they bring in large amounts of data but do not reuse much of it. Consider a video...
Describe a recursive algorithm for finding the maximum element in an array, A, of n elements. What is your running time and space usage?
Bob built a website and gave the URL only to his n friends, which he numbered from 1 to n. He told friend number i that he/she can visit the website at most i times. Now Bob has a counter, C, keeping...
Th is Exercise examines the single error correcting, double error detecting (SEC/DED) Hamming code. 1. What is the minimum number of parity bits required to protect a 128-bit word using the SEC/DED...
In this exercise, we will examine how replacement policies impact miss rate. Assume a 2-way set associative cache with 4 blocks. To solve the problems in this exercise, you may find it helpful to...
For a high-performance system such as a B-tree index for a database, the page size is determined mainly by the data size and disk performance. Assume that on average a B-tree index page is 70% full...
Give a justification of the running times shown in Table 7.1 for the methods of an array list implemented with a (nonexpanding) array.
Suppose you are given an array, A, containing n distinct integers that are listed in increasing order. Given a number k, describe a recursive algorithm to find two integers in A that sum to k, if...
Consider the set of keys K = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}. a. Draw a (2,4) tree storing K as its keys using the fewest number of nodes. b. Draw a (2,4) tree storing K as its keys using the...
The dining philosophers problem is a classic problem of synchronization and concurrency. The general problem is stated as philosophers sitting at a round table doing one of two things: eating or...
The operation get(k) for our multimap ADT is responsible for returning a collection of all values currently associated with key k. Design a variation of binary search for performing this operation on...
What is the expected running time of the methods for maintaining a maxima set if we insert n pairs such that each pair has lower cost and performance than one before it? What is contained in the...
Although keys in a map are distinct, the binary search algorithm can be applied in a more general setting in which an array stores possibly duplicative elements in nondecreasing order. Consider the...
Consider the following variant of the findIndex method of the SortedTableMap class, originally given in Code Fragment 10.11: Does this always produce the same result as the original version? Justify...
Explain how the k largest elements from an unordered collection of size n can be found in time O(nlogk) using O(k) auxiliary space.
Suppose two binary trees, T 1 and T 2 , hold entries satisfying the heap-order property (but not necessarily the complete binary tree property). Describe a method for combining T 1 and T 2 into a...
Bill claims that a preorder traversal of a heap will list its keys in nondecreasing order. Draw an example of a heap that proves him wrong.
At which positions of a heap might the largest key be stored?
Let the rank of a position p during a traversal be defined such that the first element visited has rank 1, the second element visited has rank 2, and so on. For each position p in a tree T, let...
Give an O(n)-time algorithm for computing the depths of all positions of a tree T, where n is the number of nodes of T.
What are the minimum and maximum number of internal and external nodes in an improper binary tree with n nodes?
Repeat the previous problem using the deque D and an initially empty stack S. Previous problem Suppose you have a deque D containing the numbers (1,2,3,4,5,6,7,8), in this order. Suppose further that...
Consider an initially empty memory cache consisting of four pages. How many page misses does the FIFO algorithm incur on the following page request sequence: (2,3,4,1,2,5,1,3,5,4,1,2,3)?
A company named RT&T has a network of n switching stations connected by m high-speed communication links. Each customers phone is directly connected to one station in his or her area. The engineers...
Given an n-node complete binary tree T, rooted at a given position, consider a directed graph G having the nodes of T as its vertices. For each parent-child pair in T, create a directed edge in G...
Let G be an undirected graph whose vertices are the integers 1 through 8, and let the adjacent vertices of each vertex be given by the table below: vertex adjacent vertices...