This question refers to the below PDP8 datapath that is valid only for instructi

This question refers to the below PDP8 datapath that is valid only for instructions with op codes 0-5 (the 6 standard memory-based instructions), and only for direct-access (the indirect stage is not included). So far, we have pretended on our PDP8 datapath that control lines come out of nowhere (magic!) Actually, the control lines come from a control unit that takes input from a few different sources. For the subset of instructions supported by the datapath above, the control unit will input the 3-bit op code of the instruction (held in the IR), and a single bit from the Major State Generator. The op code determines which instruction to execute (000=AND, 001=TAD, 010=ISZ, 011=DCA, 100=JMS, 101=JMP), and the state bit determines in which state the datapath is currently functioning (0 for fetch, and 1 for execute). This question ignores the other 2 op codes and the indirect stage. Of the control values shown in blue on the diagram above, all can be set using these 4 bits except “Page”. We have not discussed the PDP8 ALU, so you can ignore the ALUop control, but you should be able to determine the rest.Give a minimal logic expression for each of the control values. Set “don’t-care” values strategically to minimize the expressions. Usec2, c1,andc0to represent the 3 bits from the op code, withc2most significant. Usesto represent the state bit. Minimize each expression however you want, but given the 4 input bits, one Karnaugh map for each control will definitely work. As an example, the minimal expression forIRwis just~s(not s), as IR should be written always when in the fetch state, and never when in the execute state. The rest are probably more complicated. Notes on this datapath implementation: – ISZ uses the ALU to add 1 to the read data and write the result back to memory. The actual skip logic is not shown and you do not have to explain it, only the controls that are shown in blue. – DCA uses the ACin MUX to write a 0 to the AC instead of the ALU output. – You can just ignore the link bit.

1-a. Add a feature to the expression parsing code1-b. Verify through testing wit

1-a. Add a feature to the expression parsing code1-b. Verify through testing with pytest and direct connection that the expression parser works on some feature you have added.2. Verify using requests and pytest that some API on this list works correctly: https://github.com/toddmotto/public-apis3. Verify using webdriver and pytest that either “Oster” or “Hamilton Beach” is one of the blenders brands sold on Amazon on the “blender” search page.

Question 1 You are required to implement the following modes of operation: E

Question 1 You are required to implement the following modes of operation: Electronic Codebook (ECB) Cipher Block Chaining (CBC) Cipher Feedback (CFB) Output Feedback (OFB) You may use any publicly available AES code or the AES code provided Blackboard. Provide the details of the source of the AES code that you use. Note that the implementation of the modes should be your own. [3 marks] Question 2 After implementation of these four modes, you are required to encrypt an image while preserving the image structure, i.e. apply AES only on the image data, keeping the header intact. Note that images encrypted while preserving image header should be viewable using standard image viewer applications (the content could be arbitrary). Criteria for choosing the input image is as follows: Compute the sum of characters of yourfirst nameand last namemodulo 26 (Characters are numbered from 0 to 25, A or a being 0 and Z or z being 25). Refer to the following ranges to determine which images to use for encryption: 0 – 8 : triangle.jpg 9 – 17: circle.jpg 18 – 25: rectangle.jpg The three images are provided in thedatafolder. Along with these images, you are required to select two more images from publicly available images of landscapes (keywords: landscape, beach, lake, mountains etc.) with visible repeated patterns. Choose images with size 800 x 600 pixels. Analyze the output of encryption using all four modes of operation and report your observations. [3 marks] Question 3 Analyze and report the error propagation properties of different modes of operations by performing the following tests (on all three images) as mentioned in Question 2: (a) Introduce an error in a cipher text block of the encrypted images. Analyze and report the number of blocks affected in the resulting decrypted plain text. Also, specify the particular block number you have corrupted. (b) Introduce an error in a plain text block of the images. Analyze and report the number of blocks affected in the resulting cipher text and the decrypted plain text. Report your results for all four modes of operation (ECB, CBC, CFB, and OFB) with all three images in your data set. Report the index position of the block you introduced the error in, number of blocks affected, the percentage error and your observations. You can compute the percentage error using the formula: Submission You must submit the following via UAlbany Blackboard:(a) Source code along with the instructions to run it.(b) A pdf file containing answers to Questions 2 and 3.(c) A video (of max 5 minutes) that shows the working of your program.

In the usual MIPS instruction set,swandlwcalculate the memory address by adding

In the usual MIPS instruction set,swandlwcalculate the memory address by adding the immediate to a register. For example,sw$t0, 4($t1) stores the value in $t0 to the address $t1+4.You could, however, designswandlwdifferently, such that they add 2 register values to determine the memory address, instead of using the immediate. For example,sw$t0, $t1($t2) would store the value in $t0 to the address $t1+$t2. Describe in detail how you would change the MIPS single-cycle datapath to implement these new stores/loads. You can do this by implementing the changes in Logisim to the simplified singleCycle.circ file I have provided. modifying the standard datapath diagram to show the new components/paths,AND describing in words the new flow for stores/loads. In either method, the datapath NO LONGER needs to implement the old style of stores/loads, but should still support the other instructions we have discussed (e.g. add, addi, beq, etc.). Be sure to consider any units (registers, MUX’s, etc.) you would need to add, or how you would use the existing pieces differently. Also, make clear any control values you would need to add/modify and how you would use them.

Assume that each of the 5 stages in our standard MIPS pipelined datapath takes 2

Assume that each of the 5 stages in our standard MIPS pipelined datapath takes 200ps (picoseconds) to complete. We want to add some extra hardware, and have 2 options. Mod1: we could add several more stages to the datapath so that there are 8 total. The longest stage is still the same 200ps. Mod2: We could add everything to the first of our current stages which will make the first stage take 250ps, the rest will remain unchanged. Answer the following questions about the 2 modification options; brieflyshow your workor explain your reasoning. State thetotal timeto execute a single instructionfor eachof the modified datapaths. State the approximateaverage time per instructiongiven many instructions to executefor each of the modified datapaths. Which modification would you choose to make, and why?Be specificin your reasons!

Assignment 6.1 [75 points]See also client program, data file, and correct output

Assignment 6.1 [75 points]See also client program, data file, and correct output.This week you’ll be making the following refinements to the class that you wrote in the last assignment. All the requirements from that class are still in force. For example, all MyStrings must always be stored in a dynamic array that is exactly the correct size to store the string. Your score on this assignment will take into consideration your work on both the previous assignment and this assignment.1. Extraction OperatorJust like the >> operator that reads C-strings, your >> operator should skip any leading spaces and then read characters into the string up to the first whitespace character.For reasons of convenience, we will impose a limit of 127 on the number of characters this function will read. This is so you can temporarily read into a non-dynamic array and then copy what you need into your data member, which will be a dynamic array. Note that this does not mean that all MyStrings will always have a maximum of 127 characters. For example, you might get a MyString with more than 127 characters by using the MyString constructor or by concatenating two MyStrings.Hint: Don’t try to read character by character in a loop. Use the extraction operator to do the reading of the input into a non-dynamic array, then use strcpy() to copy it into your data member. Make sure to allocate the correct amount of memory.Hint: if you use the extraction operator as suggested above, you will not have to skip leading whitespace, because the extraction operator does that for you.2. A read() functionThe read() function will allow the client programmer to specify the delimiting character (the character at which reading will stop). It should work just like the getline() function works for c-strings; that is, it should place everything up to but not including the delimiting character into the calling object, and it should also consume (and discard) the delimiting character. This will be a void function that will take two arguments, a stream and the delimiting character. It should not skip leading spaces. The limit of 127 characters imposed on the >> function above also applies to this function.Hint: Don’t try to read character by character in a loop. Use the in.getline() function to do the reading of the input into a non-dynamic array, then use strcpy() to copy it into your data member.3. Concatenation OperatorOverload the + operator to do MyString concatenation. The operator must be able to handle either MyString objects or C-strings on either side of the operator. Be careful with the memory management here. You’ll have to allocate enough memory to hold the new MyString. I suggest using strcpy() to get the left operand into the result MyString, and then strcat() to append the right operand. Both strcpy() and strcat() should be used as if they are void, even though they do have return values.4. Combined Concatenation/Assignment OperatorOverload the shorthand += to combine concatenation and assignment. Only MyStrings can be on the left-hand side of a += operation, but either MyStrings or C-strings may appear on the right side. If you pay close attention to the += operator from the feetInches class, these may be the easiest points of the semester.5. Add DocumentationCLIENT PROGRAM/* * ——————- * These functions are designed to help you test your MyString objects, * as well as show the client usage of the class. * * The BasicTest function builds an array of strings using various * constructor options and prints them out. It also uses the String * stream operations to read some strings from a data file. * * The RelationTest function checks out the basic relational operations * (==, !=, #include // for toupper() #include #include #include using namespace std; using namespace cs_mystring; void BasicTest(); void RelationTest(); void ConcatTest(); void CopyTest(); MyString AppendTest(const MyString& ref, MyString val); string boolString(bool convertMe); int main() { BasicTest(); RelationTest(); ConcatTest(); CopyTest(); } string boolString(bool convertMe) { if (convertMe) { return “true”; } else { return “false”; } } void BasicTest() { MyString s; int stringLength; cout << "----- Testing basic String creation & printing" << endl; const MyString strs[] = {MyString("Wow"), MyString("C++ is neat!"), MyString(""), MyString("a-z")}; for (int i = 0; i < 4; i++){ cout << "string [" << i <<"] = " << strs[i] << endl; } cout << endl << "----- Now reading MyStrings from file" << endl; cout << endl << "----- first, word by word" << endl; ifstream in("mystring.txt"); assert(in); while (in.peek() == '#'){ in.ignore(128, 'n'); } in >> s; while (in) { cout << "Read string = " << s << endl; in >> s; } in.close(); cout << endl << "----- now, line by line" << endl; ifstream in2("mystring.txt"); assert(in2); while (in2.peek() == '#'){ in2.ignore(128, 'n'); } s.read(in2, 'n'); while (in2) { cout << "Read string = " << s << endl; s.read(in2, 'n'); } cout << endl << "----- Testing access to characters (using const)" << endl; const MyString s1("abcdefghijklmnopqsrtuvwxyz"); cout << "Whole string is " << s1 << endl; cout << "now char by char: "; stringLength = s1.length(); for (int i = 0; i < stringLength; i++){ cout << s1[i]; } cout << endl << "----- Testing access to characters (using non-const)" << endl; MyString s2("abcdefghijklmnopqsrtuvwxyz"); cout << "Start with " << s2; stringLength = s2.length(); for (int i = 0; i < stringLength; i++){ s2[i] = toupper(s2[i]); } cout << " and convert to " << s2 << endl; } void RelationTest() { cout << "n----- Testing relational operators between MyStringsn"; const MyString strs[] = {MyString("app"), MyString("apple"), MyString(""), MyString("Banana"), MyString("Banana")}; for (int i = 0; i < 4; i++) { cout << "Comparing " << strs[i] << " to " << strs[i+1] << endl; cout << "tIs left < right? " << boolString(strs[i] < strs[i+1]) << endl; cout << "tIs left <= right? " << boolString(strs[i] <= strs[i+1]) << endl; cout << "tIs left > right? ” << boolString(strs[i] > strs[i+1]) << endl; cout << "tIs left >= right? ” << boolString(strs[i] >= strs[i+1]) << endl; cout << "tDoes left == right? " << boolString(strs[i] == strs[i+1]) << endl; cout << "tDoes left != right ? " << boolString(strs[i] != strs[i+1]) << endl; } cout << "n----- Testing relations between MyStrings and char *n"; MyString s("he"); const char *t = "hello"; cout << "Comparing " << s << " to " << t << endl; cout << "tIs left < right? " << boolString(s < t) << endl; cout << "tIs left <= right? " << boolString(s <= t) << endl; cout << "tIs left > right? ” << boolString(s > t) << endl; cout << "tIs left >= right? ” << boolString(s >= t) << endl; cout << "tDoes left == right? " << boolString(s == t) << endl; cout << "tDoes left != right ? " << boolString(s != t) << endl; MyString u("wackity"); const char *v = "why"; cout << "Comparing " << v << " to " << u << endl; cout << "tIs left < right? " << boolString(v < u) << endl; cout << "tIs left <= right? " << boolString(v <= u) << endl; cout << "tIs left > right? ” << boolString(v > u) << endl; cout << "tIs left >= right? ” << boolString(v >= u) DATA FILE# This file has some strings that are used in the string test to check # reading strings from files. The default overloaded >> of your string # class should skip over any leading spaces and read characters into # the string object, stopping at the first whitespace character (this is # similar to the behavior of >> on char *). The read method of the # string class is a little fancier. It allows client to restrict # how many characters at max to read and what character to use as # delimiter, so you can stop at newline instead of space, for example. # Reading consumes the delimiting character, so the next read starts # after that. # The first time we will read individual words, next we read whole linesCORRECT OUTPUT—– Testing basic String creation & printing string [0] = Wow string [1] = C++ is neat! string [2] = string [3] = a-z —– Now reading MyStrings from file —– first, word by word Read string = The Read string = first Read string = time Read string = we Read string = will Read string = read Read string = individual Read string = words, Read string = next Read string = we Read string = read Read string = whole Read string = lines —– now, line by line Read string = The first time we will Read string = read individual words, next Read string = we read whole lines —– Testing access to characters (using const) Whole string is abcdefghijklmnopqsrtuvwxyz now char by char: abcdefghijklmnopqsrtuvwxyz —– Testing access to characters (using non-const) Start with abcdefghijklmnopqsrtuvwxyz and convert to ABCDEFGHIJKLMNOPQSRTUVWXYZ —– Testing relational operators between MyStrings Comparing app to apple Is left < right? true Is left <= right? true Is left > right? false Is left >= right? false Does left == right? false Does left != right ? true Comparing apple to Is left < right? false Is left <= right? false Is left > right? true Is left >= right? true Does left == right? false Does left != right ? true Comparing to Banana Is left < right? true Is left <= right? true Is left > right? false Is left >= right? false Does left == right? false Does left != right ? true Comparing Banana to Banana Is left < right? false Is left <= right? true Is left > right? false Is left >= right? true Does left == right? true Does left != right ? false —– Testing relations between MyStrings and char * Comparing he to hello Is left < right? true Is left <= right? true Is left > right? false Is left >= right? false Does left == right? false Does left != right ? true Comparing why to wackity Is left < right? false Is left <= right? false Is left > right? true Is left >= right? true Does left == right? false Does left != right ? true —– Testing concatentation on MyStrings outrageous + milk = outrageousmilk milk + = milk + cow = cow cow + bell = cowbell —– Testing concatentation between MyString and char * abcde + XYZ = abcdeXYZ XYZ + abcde = XYZabcde —– Testing shorthand concat/assign on MyStrings who += what = whowhatandwhowhat what += WHEN = whatWHENandwhatWHEN WHEN += Where = WHENWhereandWHENWhere Where += why = WherewhyandWherewhy —– Testing shorthand concat/assign using char * I love += programming = I love programming —– Testing copy constructor and operator= on MyStrings original is cake, copy is fake original is cake, copy is fake after self assignment, copy is Copy Cat Testing pass & return MyStrings by value and ref after calling Append, sum is BinkyBoo val is winky after assign, val is BinkyBoo