All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
business
principles algorithms and systems
Questions and Answers of
Principles Algorithms And Systems
13. Write a machine language program to output the three characters Cat on the output device.Write it in a format suitable for the loader and execute it on the Pep/9 simulator.
12. Write a machine language program to output the four characters Frog on the output device.Write it in a format suitable for the loader and execute it on the Pep/9 simulator.
11. Write a machine language program to output your name on the output device. The name you output must be longer than two characters. Write it in a format suitable for the loader and execute it on
10. Suppose you need to process a list of 31,000 integers contained in Pep/9 memory at one integer per word. You estimate that 20% of the instructions in a typical program are unary instructions.
9. Determine the output of the following Pep/9 machine language program. The left column in each part is the memory address of the first byte on the line:*(a)0000 C1000A 0003 81000C 0006 F1FC16 0009
8. Determine the output of the following Pep/9 machine language program if the input is tab. The left column is the memory address of the first byte on the line:0000 D1FC15 0003 F1001F 0006 D1FC15
7. Determine the output of the following Pep/9 machine language program. The left column is the memory address of the first byte on the line:0000 D10013 0003 F1FC16 0006 D10014 0009 F1FC16 000C
6. Repeat Exercise 5 for the following statements:(a) C90A3F(b) D90A3F(c) F10A41(d) E10A41(e) 690A3F(f) 710A41(g) 890A3F(h) 990A3F(i) 06
5. Suppose Pep/9 contains the following four hexadecimal values:A: 19AC X: FE20 Mem[0A3F]: FF00 Mem[0A41]: 103D If it has these values before each of the following statements executes, what are the
4. Answer the questions in Exercise 3 for the machine language instructions 7B00AC and F70BD3.
3. Answer the following questions for the machine language instructions 6AF82C and D623D0.(a) What is the opcode in binary? (b) What does the instruction do? (c) What is the register-r field in
2. (a) Suppose the main memory of the Pep/9 were completely filled with unary instructions.How many instructions would it contain? (b) What is the maximum number of instructions that would fit in the
1. (a) How many bytes are in the main memory of the Pep/9 computer? (b) How many words are in it? (c) How many bits are in it? (d) How many total bits are in the Pep/9 CPU? (e)How many times bigger
21. Perform the following logical operations, assuming a nine-bit cell: 0 1001 0011 AND 1 0111 0101 N = (a) 7 = AND N = 0 0000 1111 10111 0101 (b) Z = 0 1001 0011 OR 1 0111 0101 N = (c) 7 = 0 0000
20. Perform the following logical operations, assuming a seven-bit cell: 010 1100 AND 110 1010 N = (a) Z = 000 1111 AND 101 0101 N = (b) Z = 010 1100 OR 110 1010 N = (c) Z = 000 1111 OR 101 0101 N =
18. Perform the following additions, assuming nine-bit two’s complement binary representation.Show the effect on the status bits: 0 1010 1100 ADD 00011 1010 N = z = V = (a)C= 11110 0101 ADD 00011
17. Perform the following additions, assuming seven-bit two’s complement binary representation. Show the effect on the status bits: 010 1011 ADD 000 1110 N = Z= V = (a) C =
9. Perform the following additions on unsigned integers, assuming a nine-bit cell. Show the effect on the carry bit: 0 0100 1011 ADD 01101 0001 (a) C= 1 0001 1101 ADD 0 1110 1000 (b) C.= 1 1111 1111
8. Perform the following additions on unsigned integers, assuming a seven-bit cell. Show the effect on the carry bit: ADD (a) C = 010 1011 100 1001
18. Declare the following node for a binary search tree:struct node {node *left;int data;node *right;};where left is a pointer to the left subtree and right is a pointer to the right subtree. Write a
17. The program in Figure 2.41 creates a linked list whose elements are in reverse order compared to their input order. Modify the first loop of the program to create the list in the same order as
16. Write a function int maximum (int list[], int n)that recursively finds the largest integer between list[0] and list[n]. Assume at least one element is in the list. Test it with a main program
15. Write a recursive void function called rotateLeft() with two parameters, an array and an integer count n, that rotates the first n integers in the array to the left. To rotate n items left,
14. Write a C program that prints the solution to the Towers of Hanoi puzzle. It should ask the user to input the number of disks in the puzzle, the peg on which all the disks are placed initially,
13. Write a C program that asks the user to input a small integer. Then use a recursive function that returns the value of that Fibonacci number as defined in Exercise 4. Do not use a loop.Output the
12. Write a C function void rect(int *ar, int *per, int len, int wid)that computes the area ar and perimeter per of a rectangle with length len and width wid. Test it with a main program that inputs
11. Write a C function int rectArea (int len, int wid)that returns the area of a rectangle with length len and width wid. Test it with a main program that inputs the length and width of a rectangle
10. Write a C program that inputs two integers and outputs the sum of the integers between them.Sample Input 9 12 Sample Output The sum of the numbers between 9 and 12 inclusive is 42.
9. Write a C program that inputs an integer and outputs whether the integer is even.Sample Input 15 Sample Output 15 is not even.
8. Write a C program that inputs two integers and outputs their quotient and remainder. To output the % character, you must write it as %% in the format string.Sample Input 13 4 Sample Output 13/4
7. Examine the C program that follows: (a) Draw the run-time stack just after the procedure is called for the last time, including the stack frame for main(). (b) What is the output of the
6. The mystery numbers are defined recursively as myst(n)={2ifn=0,1ifn=1,2×myst(n−1)+myst(n−2)ifn>1.(a) Draw the call tree in the style of Figure 2.30 for myst(4).(b) What is the value of
5. For your solution to the Towers of Hanoi in Problem 2.14, draw the call tree for the fourdisk problem. How many times is your procedure called, including the call from main()? What is the maximum
4. The Fibonacci sequence is 0 1 1 2 3 5 8 13 21 . . .Each Fibonacci number is the sum of the preceding two Fibonacci numbers. The sequence starts with the first two Fibonacci numbers and is defined
3. Draw the call tree in the style of Figure 2.30 for the program in Figure 2.32 to reverse the letters of an array of characters, assuming the initial string is "Backward". How many times is
2. Each exercise below has five parts, as follows: (1) Draw the call tree in the style of Figure 2.30 for the function binCoeff() of Figure 2.28 assuming the given call statement from the main
1. The function sum() in Figure 2.25 is called for the first time by the main program. From the second time on, it is called by itself. *(a) How many times is it called altogether, including the call
23. (a) Write the statements to produce Result2 in Figure 1.32, but with the project command before the select. (b) Write the statements to produce Result3 in Figure 1.22, but with join as the last
22. Write the statements for the following queries of the database in Figure 1.31. *(a) Find Beth’s home state. (b) List the fraternity members who are English majors. (c) List the sorority and
21. Write the relations Temp5 and Temp6 from the discussion in Section 1.5 of the chapter.
20. A tablet has a 7.5- × 5.8-inch screen size with a resolution of 326 pixels per inch. (a) How many pixels does it have? (b) With 256 levels of brightness for each color subpixel, what is the MiB
19. A mobile phone has a 3.48- × 1.96-inch screen size with a resolution of 326 pixels per inch.(a) How many pixels does it have? (b) With 256 levels of brightness for each color of subpixel, what
18. An eReader has a 956- × 1290-pixel grayscale display with each pixel able to display 32 shades of gray. What is the KiB size of the display memory for the device?
17. (a) A desktop laser printer has a 300 dots-per-inch resolution. If each dot is stored in one bit of memory, how many MiB of memory are required to store the complete image of one 8.5- ×11-inch
16. (a) How many bits are available for storing information in a 57 × 57 Version 10 QR code?This version has four alignment patterns that do not intersect a timing pattern and two that do intersect
15. (a) How many bits are available for storing information in a 49 × 49 Version 8 QR code?This version has four alignment patterns that do not intersect a timing pattern and two that do intersect a
14. How many total bits are stored in the grid of a Version 4 QR code?
13. A typist is entering text on a keyboard at the rate of 30 words per minute. If each word is 6 characters long on average, what bandwidth in bits per second between the keyboard and main memory is
12. A typist is entering text on a keyboard at the rate of 40 words per minute. If each word is 5 characters long on average, what bandwidth in bits per second between the keyboard and main memory is
11. How long would it take to transfer a 600-MB database from disk to memory over a DMA channel with a bandwidth of 2.5 GB/s?
10. If an app requires the execution of 30 million instructions to complete a task and your CPU is rated at 2.8 GHz, what is the execution time of the task? Assume that each ISA3 instruction executes
9. If an app requires the execution of 20 million instructions to complete a task and your CPU is rated at 2.1 GHz, what is the execution time of the task? Assume that each ISA3 instruction executes
8. Determine how to perform each of the following procedures with your operating system. (a)Set up a new user account. (b) Display the names of the files and subdirectories at the root directory. (c)
7. Answer the following questions about your operating system. (a) What is the name of your operating system? (b) Are certain characters disallowed or problematic in the names of the files? (c) Does
(b) What is a program?
6. (a) What is an algorithm?
(f) Main memory has faster access time than disk memory. True or false?
(e) Main memory has greater storage capacity than disk memory. True or false?
(d) Disk memory is accessed sequentially True or false?.
(c)Disk memory is volatile. True or false?
(b) Main memory is accessed sequentially. True or false?
(a) Main memory is volatile. True or false?
4. A full binary tree is a tree whose leaves are all at the same level, and every node that is not a leaf has exactly two nodes under it. FIGURE 1.36 is a full binary tree with three levels. *(a)
3. In the Bible, Exodus Chapter 18 describes how Moses was overwhelmed as the single judge of Israel because of the large number of trivial cases that were brought before him. His father-in-law,
2. Genghis Khan organized his men into groups of 10 soldiers under a “leader of 10.” Ten“leaders of 10” were under a “leader of 100.” Ten “leaders of 100” were under a “leader of
1. (a) Draw a hierarchy diagram that corresponds to the United States Constitution. (b) Based on Figure 1.5, draw a nesting diagram that corresponds to the organization of the hypothetical publishing
A GPS system in an automobile has a 4.5- × 2.5-inch screen with 120 color pixels per inch. Each subpixel color can display 64 levels of brightness. What is the KiB size of the display memory?
Example 1.6 An eReader has a 1072- × 1448-pixel grayscale display, with each pixel able to display 16 shades of gray. What is the KiB size of the display memory for the device?
Example 1.5 How many ASCII characters can be stored in a 29 × 29 Version 3 QR code with one alignment pattern that does not intersect a timing pattern using Level L error correction with 25%overhead?
1.4 How many bits are available for storing information in the Version 7 QR code of Figure 1.22(a)?
A typist is entering some text on a computer keyboard at the rate of 35 words per minute. How large must the bandwidth of the channel be to accommodate the information flow between the typist and the
1.2 The bandwidth of a DMA channel between the hard drive and main memory in a computer system is quoted as 3 Gb/s. How long would it take to do a DMA transfer from the hard drive to main memory of
Suppose your CPU is rated at 2.5 GHz and you execute a program task on your app that requires the execution of 16 million ISA3 instructions. If each ISA3 instruction executes an average of 3.7 Mc2
41. This problem is a project to write a simulator in C for the Pep/9 computer.(a) Write a loader that takes a Pep/9 object file in standard format and loads it into the main memory of a simulated
40. Translate to Pep/9 assembly language your C solution from Problem 2.18 that inputs an unordered list of integers with –9999 as a sentinel into a binary search tree, then outputs them with an
39. Insert the following C code fragment in main() of Figure 6.48 just before the return statement:first2 = 0; p2 = 0;for (p = first; p != 0; p = p->next) {p2 = first2;first2 = (struct node *)
38. Insert the following C code fragment between the declaration of node and main() in Figure 6.48:void reverse(struct node *list) {if (list != 0) {reverse(list->next);printf("%d ", list->data);}}and
37. Insert the following C code fragment in main() of Figure 6.48 just before the return statement:sum = 0; p = first;while (p != 0) {sum += p->data;p = p->next;}printf("Sum: %d", sum);and translate
36. Translate to Pep/9 assembly language the C program from Figure 6.48 that manipulates a linked list, but declare first, p, and value as global variables.
35. Translate to Pep/9 assembly language the C program from Figure 6.46 that accesses the fields of a structure, but declare bill as a local variable in main().
34. Translate the following C program to Pep/9 assembly language.#include int main () {int guess;printf("Pick a number 0..3: ");scanf("%d", &guess);switch (guess) {case 0: printf("Not close");
33. Translate the following C program to Pep/9 assembly language:#include int main () {int guess;printf("Pick a number 0..3: ");scanf("%d", &guess);switch (guess) {case 0: case 1: printf("Too low");
32. Translate to Pep/9 assembly language the C program from Figure 2.32 that reverses the elements of a local array using a recursive procedure. Initialize word to "star" with five pairs of load
31. Translate to Pep/9 assembly language the C program from Figure 2.25 that adds four values in an array using a recursive function.
30. Translate the C program in Problem 29 to Pep/9 assembly language, but declare list and numItems to be global variables.
29. Translate the following C program to Pep/9 assembly language:#include void getList(int ls[], int *n) {int j;scanf("%d", n);for (j = 0; j < *n; j++) {scanf("%d", &ls[j]);}}void putList(int ls[],
28. Translate the C program in Problem 27 to Pep/9 assembly language, but declare list, j, numItems, and temp to be local variables in main().
27. Translate the following C program to Pep/9 assembly language:#include int list[16];int j, numItems;int temp;int main() {scanf("%d", &numItems);for (j = 0; j < numItems; j++) {scanf("%d",
26. (a) Rewrite the C program of Figure 2.22 to compute the factorial recursively, but use procedure times() in Problem 24 to do the multiplication. Use one extra local variable in fact()to store the
25. Translate the C program in Problem 24 to Pep/9 assembly language, but declare product, n, and m to be local variables in main().
23. The recursive binomial coefficient function in Figure 6.25 can be simplified by omitting y1 and y2 as follows:int binCoeff(int n, int k) {if ((k == 0) || (n == k)) {return 1;}else {return
22. Translate to Pep/9 assembly language your C solution from Problem 2.14 that outputs the instructions for the Towers of Hanoi puzzle.
21. Translate to Pep/9 assembly language your C solution from Problem 2.13 that computes a Fibonacci term using a recursive function.
20. Write a C program that defines int minimum(int j1, int j2)which returns the smaller of j1 and j2. (a) Write your program with a global variable for the actual parameter. Translate your C program
19. Write a C program that converts an uppercase character to a lowercase character. Declare function char toLower(char ch);to do the conversion. If ch is not an uppercase character, the function
18. Translate the following C program to Pep/9 assembly language. It multiplies two integers using a recursive shift-and-add algorithm. mpr stands for multiplier and mcand stands for multiplicand.A
17. Translate the C program in Problem 16 to Pep/9 assembly language, but declare myAge to be a local variable in main().
16. Translate the following C program to Pep/9 assembly language.#include int myAge;void putNext(int age) {int nextYr;nextYr = age + 1;printf("Age: %d", age);printf("Age next year: %d", nextYr);}int
15. Translate the following C program to Pep/9 assembly language.#include int main() {int numItms, j, data, sum;scanf("%d", &numItms);sum = 0;for (j = 1; j
14. Translate the C program in Figure 6.12 to Pep/9 assembly language but with the do loop test changed to while (cop
Showing 300 - 400
of 640
1
2
3
4
5
6
7