Question
The classic MIPS 5-stage pipeline is depicted below. instruction decode and execute memory write fetch register fetch access back (i) With reference to the 5-stage
The classic MIPS 5-stage pipeline is depicted below. instruction decode and execute memory write fetch register fetch access back (i) With reference to the 5-stage pipeline, what are data hazards and how can they be resolved to ensure that the programmer's model of sequential execution is always preserved whilst minimising performance impact? [6 marks] (ii) With reference to thestage pipeline, what are control hazards and how can they be resolved? [4 marks] (b) If we wanted the above pipeline to mimic two processors running at half the speed, then we could have two copies (A and B) of the register state and keep the existing pipeline. The instruction-fetch stage would alternate between fetching from threads A and B on alternate clock cycles. As a consequence, if instruction fetch was from thread B, then an instruction from thread A would be in decode, B in execute, A in memory access and B in write back. (i) For this dual-threaded processor, if branches are performed in the decode stage, does the pipeline exhibit a branch delay slot? [5 marks] (ii) How can the resolution of data hazards be simplified for this dual-threaded processor? [5 marks]
How do software engineering tools change as systems scale? Discuss this question with refer-line device driver for a safety-critical sensor on board an aircraft; (b) a 100,000-line engine control unit for a diesel engine that adapts it for use in trucks, generators or irrigation pumps; (c) a 1,000,000-line social networking site such as Facebook or MySpace-line operating system.
(a) Describe five physical properties of a communications channel. [5 marks] (b) Consider the figure below. Entities N and N0 use an ARQ system. Channel - 1 Channel Channel + 1 Entity - 1 Entity Entity + 1 Entity - 1 Entity Entity + 1 n n n N N N N' N' N' (i) Explain how the latency of channel n 1 can have a direct effect on the capacity of channel n. [6 marks] (ii) Define windowing as it relates to an ARQ system and describe how the capacity of the ARQ system may be improved through its use. [4 marks] (iii) If an ARQ system is used for an interactive session, the ARQ system can lead to many small packets, each under-full and perhaps sent with significant overhead. Design and describe an algorithm that overcomes the limitation of sending many mostly-empty packets for an interactive session. [5 marks
(a) A web server is an application that listens for incoming network connections on TCP port 80. Once a connection is established, the task of processing client requests and sending replies can be handled by an instance of a Worker class which you may assume already exists. Worker implements the java.lang.Runnable interface and has an accessible constructor that takes as argument a java.net.Socket object representing the network connection to a client. Provide the Java code for a webserver which, upon start-up, attempts to listen on TCP port 80 and starts a new Thread running a new Worker for every connection. Your program should print helpful error messages indicating the likely cause of problems when it is unable to proceed as expected. [10 marks] (b) A busy web server might expect to handle concurrent requests to read and update some shared data and could use Timestamp Ordering (TSO) to enforce isolation between concurrent transactions. (i) Explain how TSO enforces isolation. [5 marks] (ii) Is TSO appropriate for a web server application? Explain your reasoning. [5 marks]
CONTEXT: The purpose is to build a machine learning workflow that will work autonomously irrespective of Data and users can save efforts involved in building workflows for each dataset.
PROJECT OBJECTIVE: Build a machine learning workflow that will run autonomously with the CSV file and return the best-performing model.
1. Build a simple ML workflow that will accept a single '.csv' file as input and return a trained base model that can be used for predictions.
2. Create separate functions for various purposes.
For Example Separate function to remove null values, a separate function for normalization, etc.
3. Once you are done with building smaller functions, you can group similar functions into another function to proceed with. For Example: write a function 'preprocessing_' and call all the preprocessing related functions within that function.
4. Once done with the above, Stack all the functions sequentially within the 'main' function to conclude.
5. Various base models should be trained to select the best-performing model.
6. Pickle file should be saved for the best-performing model. Include best coding practices in the code: Modularization Maintainability Well commented code etc.
Make a program in python that stores and uses a series of weather values (low temperature, high temperature, probability of precipitation) with a named tuple:
Define a named tuple. Do the following for two days: Enter a low temperature, a high temperature and the probability of precipitation. Store the values to the named tuple. Let the user choose to work with one of the following: the low temperatures, the high temperatures or the probability off perception. If the low temperatures are chosen: Determine if the temperatures are the same or different. Find and show their difference (as an absolute). If the high temperatures are chosen: Determine if the temperatures are the same or different. Find and show their difference (as an absolute). If the probabilities of perception are chosen: Determine if the probabilities are the same or different. Find and show their average. When accessing individual elements, refer to the field names instead of the index values.
Many mathematical problems require the addition, subtraction, and multiplication of two matrices. Write an ADT Matrix. You may use the following class definition: const int MAX ROWS = 10; const int MAX COLS = 10; class MatrixIype public: MatrixType0; void MakeEmpty0: void SetSize(int rowsSize, int colSize); void Storeltem(int item, int row, int col); void Add(Matrixlype otherOperand, Matrixlype& result); void Sub(Matrix Type otherOperand, MatrixIype& result; void Mult(MatrixType otherOperand, MatrixType& result); void Print(ofstream& outfile); bool AddSubCompatible(Matrixlype otherOperand); bool MultCompatible(MatrixType otherOperand); private: int values[MAX_ROWSIIMAX COLS; int numRows;
bool MultCompatible(MatrixType otherOperand); private: int values[MAX_ROWS][MAX_COLS]; int numRows; int numCols; Every instantiation of MatrixType will give you a new matrix. Initially, in the constructor, both the number of rows and the number of columns are set to 0. This indicates that an empty matrix is created. Then, the user is asked to provide the number of rows, the number of columns and the value for each combination of row and column. To represent the matrices you need to consider an array (Matrix[10) of MatrixType. Initially, the length of this array, LenthMatrix, is = 0. The index of the array can be 0 to 9, i.e., there can be at most 10 matrices at any given time. Note that the class provides two member functions, AddSubCompatible and MultCompatible, to allow the client to determine if the binary matrix operations (addition, subtraction and multiplication) are possible. For example, adding a matrix of size 3X4 with another matrix 3X7 is infeasible. You need to check such necessary preconditions for each operation. If an operation is not possible, you should provide appropriate error message to user An example of output Enter the corresponding number for your desired operation: 1- get a new matrix; 2- add two matrices; 3 - subtract a matrix from another; 4- multiply two matrices; 5- print matrix 6-end the program 1 A matrix with OX0 is created. Enter the number of rows and the number of columns:
Enter the values: 4 7 93167 5 19 100 99 3 17 Thank you. You now have total 1 matrices in system Enter the corresponding number for your desired operation: 1- get a new matrix; 2- add two matrices; 3 subtract a matrix from another; 4- multiply two matrices; 5 print matrix; 6-end the program 5 Enter the matrix number for printing: 1 The input is invalid. Enter the corresponding number for your desired operation: 1- get a new matrix; 2- add two matrices; 3 - subtract a matrix from another; 4- multiply two matrices; 5 print matrix; 6-end the program 5 Enter the matrix number for printing: 0 The matrix 0 is: 4 7 93167 5 19 100 993 17 Enter the corresponding number for your desired operation: 1- get a new matrix; 2- add two matrices; 3 - subtract a matrix from another; 4- multiply two matrices; 5- print matrix; 6-end the program 2 Let you want to perform C=A+B. Enter A, B and C: 0 1 3 The operation is not compatible. Enter the corresponding number for your desired operation: 1-get a new matrix; 2-add two matrices; 3 subtract a matrix from another; 4 multiply two matrices; 5 print matrix 6-end the program 1A matrix with 0X0 is. You now have total 2 matrices in system. Enter the corresponding number for your desired operation: 1 - get a new matrix; 2 - add two matrices; 3 subtract a matrix from another; 4- multiply two matrices; 5 print matrix; 6- end the program 1A matrix with OX0 is created. Enter the number of rows and the number of columns: 3 4 Enter the values: 7 19 13 6527 51 17 10 13 20 15 Thank you. You now have total 3 matrices in system. Enter the corresponding number for your desired operation: 1-get a new matrix; 2-add two matrices; 3 subtract a matrix from another; 4- multiply two matrices; 5- print matrix; 6-end the program 1 A matrix with 0XO is created. Enter the number of rows and the number of columns: 3 4 Enter the values: 17 19 13 6 53 127 10 18 103 220 5 Enter the corresponding number for your desired operation: 1 - get a new matrix; 2 add two matrices; 3 - subtract a matrix from another; 4 - multiply two matrices; 5- print matrix 6- end the program 2 Let you want to perform C=A+B. Enter A, B and C: 0 2 3 Matrices 0 and 2 are added and the result is stored in matrix 3. Enter the corresponding number for your desired operation: 1 - get a new matrix; 2 add two matrices; 3 subtract a matrix from another; 4- multiply two matrices; 5 print matrix 6- end the program 5 Enter the matrix number for printing: 3 The matrix 3 is: 11 26 22 9 6 84 56 36 110 112 23 32 Enter the corresponding number for your desired operation: 1- get a new matrix; 2- add two matrices; 3- subtract a matrix from another, 4 multiply two matrices; 5-print matrix; 6-end the program 3 Let you want to perform C=A-B. Enter A, B and C:03 2 Matrix 3 is subtracted from matrix 0, and the result is stored in matrix 2. Enter the corresponding number for your desired operation: 1-get a new matrix; 2-add two matrices; 3 - subtract a matrix from another; 4- multiply two matrices; 5- print matrix; 6-end the program 4 Let you want to perform C=A*B. Enter A, B and C: 0 3 1 The operation is not compatible. Enter the corresponding number for your desired operation: 1- get a new matrix; 2- add two matrices; 3 - subtract a matrix from another; 4- multiply two matrices; 5- print matrix 6-end t Thank you. You now have total 5 matrices in system. Enter the corresponding number for your desired operation: 1 - get a new matrix; 2- add two matrices; 3 subtract a matrix from another; 4 multiply two matrices; 5print matrix; 6-end the program 4 Let you want to perform C=A*B. Enter A, B and C:014 Matrices 0 and 1 are multiplied, and the result is stored in matrix 4.
kindly answer all
Step by Step Solution
There are 3 Steps involved in it
Step: 1
MIPS Pipeline Hazards and Resolutions i Data Hazards Definition Data hazards occur when an instruction depends on the result of a previous instruction that hasnt completed execution yet This can stall ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started