Assignment Chef icon Assignment Chef

Browse assignments

Assignment catalog

33,401 assignments available

[SOLVED] Sdev325 – homework 1

Configuring your Lab Environment Overview In this homework you will configure an AWS Cloud9 programming environment supporting programming languages of Java, C/C++, Python and others. Multiple languages will be used as we detect and mitigate software errors. Becoming comfortable with your programming environment will set the foundation for the rest of the assignments. Assignment To successfully complete this assignment (and this course), you will need to configure your environment for testing multiple languages. Follow the documentation available in the AWS Cloud Resources content area, be sure you have successfully created an AWS Education Starter account and started your Cloud0 environment. Once you have completed configuring your AWS and Cloud9 accounts, use Cloud9 to create your own unique Hello, World application Java, Python and the C++ programming language. Be sure your code runs properly within the Cloud9 environment. Note, by unique, you should specifically place at least 4 additional lines of code beyond the Hello, World output. I leave it up to you to make a special greeting message, a timestamp, or some other special signature output that you create. Deliverables Provide your Hello, World source files for each language (Java, Python and C++). Discuss the steps you had to perform to get the source code running within the Cloud9 environment. You should also provide well-organized and labeled screen shots in a word or PDF file documenting the successful running of each of your Hello, World Applications. Note: Be sure to provide all screen shots in one word of PDF document. You can compress the files using a zip application for easier upload. Grading Rubric: Attribute Meets Does not meet Cloud9: Java 25 points Creates your own unique Hello, World application using the Cloud9 IDE for Java SE environment (15 points)Code runs properly within the Cloud9 environment. (10 points) 0 points Does not create your own unique Hello, World application using the Cloud9 IDE for Java SE environmentCode does not run properly within the Cloud9 environment. Cloud9: Python 25 points Creates your own unique Hello, World application using the Cloud9 IDE for Python. (15 points) 0 points Does not create your own unique Hello, World application using the Cloud9 IDE for Python.1Code runs properly within the Cloud9 environment. (10 points) Code does not run properly within the Cloud9 environment. Cloud9: C++ 25 points Creates your own unique Hello, World application using the Cloud9 IDE for C++. (15 points)Code runs properly within the Cloud9 environment. (10 points) 0 points Does not create your own unique Hello, World application using the Cloud9 IDE for C++.Code does not run properly within the Cloud9 environment. Documentation and submissions 25 points Delivers Hello, World source files for each language (Java, Python and C++). (10 points)Discusses the steps performed to get Python and C++ running within the Cloud9 environment. (5 points)Provides well-organized and labeled screen shots in a word or PDF file documenting the successful running of each Hello, World Applications. (5 points)Delivers one word or PDF document. (5 points) 0 points Does not deliver Hello, World source files for each language (Java, Python and C++).Does not discuss the steps performed to get Python and C++ running within the Cloud9 environment.Does not provide well-organized and labeled screen shots in a word or PDF file documenting the successful running of each Hello, World Applications.Does not deliver one word or PDF document.2

$25.00 View

[SOLVED] Sdev300 – week 8 deliverables

Overview: This week, you have studied Web application vulnerabilities, password complexity, logs and cryptographic algorithms. The Lab for this week demonstrates your knowledge of this additional knowledge applied using Python functionality. Submission requirements for this project include 2 files. (Zipping them into one file is acceptable and encouraged): • Python Web Application Code (Python code for all routes, templates, static files and other files) • Word or PDF file containing your test, pylint results and Cryptographic results.Python Applications for this lab: (total 100 points): 1. (50 points) In this exercise you will update your web site to include a password update form and provide additional validation on the password check. Specifically you should create: a. Password update Form – This Python form allows a previously registered user to reset their password after they have successfully logged in. b. Authentication functions – These Python functions will check the following NIST SP 800-63B criteria are met upon password update: • Use the previous criteria for password length and complexity. (This work should already be done.) • Compare the prospective secrets against a list that contains values known to be commonlyused, expected, or compromised (Provided as CommonPasswords.txt). • If the chosen secret is found in the list, the application SHALL advise the subscriber that they need to select a different secret.Hints: 1. Start early. This will take you longer than you think. 2. Leverage the File I/O, Flask and Data structures work previously performed in the class. 3. Use functions to enhance code reuse and modularity. 4. Use Python Lists or other data structures to store the Common Passwords and then appropriate search functions to expedite comparisons. 5. Use comments to document your code 6. Test with many combinations. 7. Use pylint to verify the code style – the goal is a 10! 2. (30 points) Using the Decrypting Secret Messages sites found in this week’s readings, decrypt the following messages. a. – …. .. … / … -.. . …- / …– —– —– / -.-. .-.. .- … … / …. .- … / … — — . / … – .-. .- -. –. . / .-. . –.- ..- . … – … .-.-.- 1b. U28gdGhpcyBpcyBiYXNlNjQuIE5vdyBJIGtub3cu c. — Psuwb Ysm —- W oa gc qzsjsf. Bc cbs qcizr dcggwpzm twuifs hvwg cih. — Sbr Ysm —Provide the decoded message along with the Cipher and any other parameters you used to solve each puzzle. Hints: 1. Use the rumkin site 2. You will need to experiment some to narrow down the possible algorithms used. Some are more obvious than others. 3. You will know when you have selected the correct Cipher3. (20 points) Document your results of the application running from your programming environment. You should also include and discuss your pylint results for the application. Provide your test results for each requirement in the Web application, associated functions and provide your resulting log files. Discuss the log file and how it could be used to possibly detect patterns of abuse. Describe the results of your NIST password complexity functions and how you tested each requirement. Include the Cipher tool results and write up in this document as well. 2

$25.00 View

[SOLVED] Sdev300 – week 7 deliverables

Overview: This week, you studied additional Flask functionality for creating a secure login form and associated files for a web site. The Lab for this week demonstrates your knowledge of this additional Python functionality. Be sure to use the examples in the textbook reading along with the associate libraries, functions and processes when completing the assignments for this week. Submission requirements for this project includes multiple files. (Zipping them into one file is acceptable and encouraged): • Python Web Page Code (Python code, Templates, CSS and other associated files) • Word or PDF file containing your test and pylint resultsPython Applications for this lab: (total 100 points): 1. (80 points) This exercise uses your programming environment to enhance the Web site you created last week with additional functionality to include images, tables and a Form using Python flask. Specifically, you will add two (2) additional routes allowing a user to register and login to a web site. Additional security considerations include other routes (beyond the register route) will not be accessible until a successful login has occurred. In addition to the requirements list above the following functionality should be found within your web site on one or more web pages. • Add at least 4 different images. The images should be local in your environment. For example, they should be saved in your environment and referenced similar to this syntax: • A Table with at least 4 rows and 3 columns. • A user registration form • A user login form • A password complexity should be enforced to include at least 12 characters in length, and include at least 1 uppercase character, 1 lowercase character, 1 number and 1 special character. The content and topic of the new images, and tables are up to you. How much is required for the user registration is up to you as well. However, the registration and associated login should contain at least a login name and password. Hints: 1. Start early. This will take you longer than you think. 2. Test all aspects of the forms from input to output on your environment. 3. Use comments to document your code 4. Test with many combinations. 5. Use pylint to verify the code style – the goal is a 10! 2. (20 points) Document your testing results using your programming environment. You should also include and discuss your pylint results for the application. The test document should include a test table 1that includes the input values, the expected results and the actual results. A screen capture should be included that shows the actual test results of running each test case found in the test table. Be sure to include multiple test cases to provide full coverage for all code and for each function you develop and test. 2

$25.00 View

[SOLVED] Sdev300 – week 6 deliverables

Overview: In this week, you have studied additional Python language syntax for rendering HTML templates using the Python Flask module. The Lab for this week demonstrates your knowledge of this additional Python functionality. Be sure to use the examples in the textbook and readings along with the associate libraries, functions and processes when completing the assignments for this week. Submission requirements for this project includes multiple 2 files. (Zipping them into one file is acceptable and encouraged): • Python Web Page Code (Python code, Templates, CSS and other associated files) • Word or PDF file containing your test and pylint resultsPython Applications for this lab: (total 100 points): This lab consists of two parts.1. (80 points) This exercise (80 points) uses your programming environment to generate a simple Web site using Python flask. The site should be unique, include at least 3 routes (e.g. 3 pages one can navigate), each route should render the HTML pages by using the render_template() functionality. A style sheet should be included that is used by all Web pages. Proper organization should take place of the web site including the location of templates and static pages. Keep in the basic HTML form for a function web page includes the following components: Page Title …your page content… In addition to the requirements list above the following functionality should be found within your web site on one or more web pages. • Use at least 3 different heading styles (e.g. , , ) • Paragraph () • Comments ) • Ordered list • Unordered list • At least 3 Links to other External Web Sites 1The content and topic of the Web site is up to you. Consider an information web site about a topic you are interested. It should be unique and something you want to create. Hints: 1. Be sure to end tags that are started (e.g. ) 2. Start early. This will take you longer than you think. 3. Use comments to document your code 4. Test with many combinations. 5. Use pylint to verify the code style – the goal is a 10!2. (20 points) Document your testing results using your programming environment. You should also include and discuss your pylint results for the application. The test document should include a test table that includes the input values, the expected results and the actual results. A screen capture should be included that shows the actual test results of running each test case found in the test table. Be sure to include multiple test cases to provide full coverage for all code and for each function you develop and test.2

$25.00 View

[SOLVED] Sdev300 – week 5 deliverables

Overview: In this week, you have studied additional Python language syntax including File I/O, Exceptions and Object-Oriented Programming. The Lab for this week demonstrates your knowledge of this additional Python functionality. Be sure to use the examples in the textbook reading along with the associate libraries, functions and processes when completing the assignments for this week.Submission requirements for this project include 4 files. (Zipping them into one file is acceptable and encouraged):• Python Data Analysis Code • 2 Input Files (Same files supplied to you) • Word, Excel or PDF file containing your test resultsPython Applications for Lab4: (total 100 points):This exercise (80 points) allows a user to load one of two CSV files and then perform histogram analysis and plots for select variables on the datasets. The first dataset represents the population change for specific dates for U.S. regions. The second dataset represents Housing data over an extended period of time describing home age, number of bedrooms and other variables. The first row provides a column name for each dataset. The following columns should be used to perform analysis:• PopChange.csv: • Pop Apr 1 • Pop Jul 1 • Change PopHousing.csv: • AGE • BEDRMS • BUILT • ROOMS • UTILITYNotice for the Housing CSV file, there are more columns in the file than are required to be analyzed. You can and should still load each column.Specific statistics should include:• Count • Mean • Standard Deviation • Min • Max • HistogramA user interface might look similar to this:***************** Welcome to the Python Data Analysis App********** Select the file you want to analyze: 1. Population Data 2. Housing Data 3. Exit the Program1 You have entered Population Data. Select the Column you want to analyze: a. Pop Apr 1 b. Pop Jul 1 c. Change Pop d. Exit Column a You selected Pop Apr 1 The statistics for this column are: Count = 10000 Mean = 32.5 Standard Deviation = 4.5 Min = 53.2 Max = 12.5 The Histogram of this column is now displayed.Select the Column you want to analyze: a. Pop Apr 1 b. Pop Jul 1 c. Change Pop d. Exit Column d You selected to exit the column menu Select the file you want to analyze: 1. Population Data 2. Housing Data 3. Exit the Program3 *************** Thanks for using the Data Analysis App********** If an inappropriate entry is detected, the program should prompt for a correct value and continue to do so until a correct value is entered. Hints:1. Use the Pandas, Numpy, MatplotLib and other Python modules when appropriate. 2. Be sure to install the required Python modules in your environment before you import or try to use them in your code. For example, pip install each of the required modules that are external Python libraries that you need. 3. If an inappropriate entry is detected, the program should prompt for a correct value and continue to do so until a correct value is entered. 4. Use comments to document your code 5. Test with many combinations. 6. Use pylint to verify the code style – the goal is a 10! 7. The user Interface should continue to run until the user indicates they are ready to exit.2. (20 points) Document your testing results using your programming environment. You should also include and discuss your pylint results for the application. The test document should include a test table that includes the input values, the expected results and the actual results. A screen capture should be included that shows the actual test results of running each test case found in the test table. Be sure to include multiple test cases to provide full coverage for all code and for each function you develop and test.

$25.00 View

[SOLVED] Sdev300 – week 4 deliverables

Overview: In this week, you have studied additional Python language syntax including Arrays and Strings. In particular, you used the numpy, regular expressions, and Panda libraries to help manipulate and store data. The Lab for this week demonstrates your knowledge of this additional Python functionality. Be sure to use the examples in the textbook reading along with the associate libraries, functions and processes when completing the assignments for this week. Submission requirements for this project include 2 files. (Zipping them into one file is acceptable and encouraged): • Python Numpy and Pandas Application Code • Word or PDF file containing your test and pylint resultsPython Applications for this lab: (total 100 points): This lab consists of two parts. 1. (80 points) allows a user to enter and validate their phone number and zipcode+4. Then the user will enter values of two, 3×3 matrices and then select from options including, addition, subtraction, matrix multiplication, and element by element multiplication. You should use numpy.matmul() for matrix multiplication (e.g. np.matmul(a, b) ). The program should compute the appropriate results and return the results, the transpose of the results, the mean of the rows for the results, and the mean of the columns for the results. When entering data, the application should use regular expressions and/or Pandas functionality to check the format of the phone number and zipcode. You should check that each value is numeric for the matrices. The user interface should continue to run until the user indicates they are ready to exit. A user interface might look similar to this: ***************** Welcome to the Python Matrix Application*********** Do you want to play the Matrix Game? Enter Y for Yes or N for No: Y Enter your phone number (XXX-XXX-XXXX: 555-555-55 Your phone number is not in correct format. Please renter: 555-555-5555 Enter your zip code+4 (XXXXX-XXXX): 21022-3213 Enter your first 3×3 matrix: 1 2 4 4 2 1 3 8 9 Your first 3×3 matrix is: 1 2 4 4 2 1 3 8 9 Enter your second 3×3 matrix: 3 2 1 7 2 5 5 2 1 Your first 3×3 matrix is: 3 2 1 7 2 5 5 2 1 Select a Matrix Operation from the list below: a. Addition b. Subtraction c. Matrix Multiplication d. Element by element multiplication a You selected Addition. The results are: 4 4 5 11 4 6 8 10 10 The Transpose is: 4 11 8 4 4 10 5 6 10 The row and column mean values of the results are: Row: 4.33, 7, 9.33 Column: 7.66, 6, 7Do you want to play the Matrix Game? Enter Y for Yes or N for No: N *********** Thanks for playing Python Numpy ***************If an inappropriate entry is detected, the program should prompt for a correct value and continue to do so until a correct value is entered. Hints: 1. Use numpy, pandas and regular expressions as appropriate. 2. Create and use functions as often as possible 3. Use comments to document your code 4. Both integers and float values are acceptable 5. Use comments to document your code 6. Test with many combinations. 7. Use pylint to verify the code style – the goal is a 10!2. (20 points) Document your testing results using your programming environment. You should also include and discuss your pylint results for the application. The test document should include a test table that includes the input values, the expected results and the actual results. A screen capture should be included that shows the actual test results of running each test case found in the test table. Be sure to include multiple test cases to provide full coverage for all code and for each function you develop and test.

$25.00 View

[SOLVED] Sdev300 – week 3 deliverables

Overview: In this week, you have studied additional Python language syntax including Lists, Sequences, Dictionaries and Sets. The Lab for this week demonstrates your knowledge of this additional Python functionality. Be sure to use these powerful data structures you studied this week when creating your code. Submission requirements for this project include multiple files. (Zipping them into one file is acceptable and encouraged): • Python State Capital and Flower List Application Code • Word or PDF file containing your test and pylint results • Flower image set – These images should be uploaded supporting the testing of your lab. Python Application for this Lab: (total 100 points): The first exercise produces a command line menu-driven python application providing users with the ability to search and display U.S. State Capital, population and Flowers. The second part documents your testing and pylint analysis results.1. (80 points) Python command line menu-driven application that allows a user to display, sort and update, as needed a List of U.S states containing the state capital, overall state population, and state flower. The Internet provides multiple references with these lists. For example: https://www.crestcapital.com/tax/us_states_and_capitals https://statesymbolsusa.org/categories/flower https://worldpopulationreview.com/states/state-capitals/ You will need to embed the State data into your Python code in a data structure of your choice, from the readings this week. The user interface will allow the user to perform the following functions: 1. Display all U.S. States in Alphabetical order along with the Capital, State Population, and Flower 2. Search for a specific state and display the appropriate Capital name, State Population, and an image of the associated State Flower. 3. Provide a Bar graph of the top 5 populated States showing their overall population. 4. Update the overall state population for a specific state. 5. Exit the program As before, generate an appropriate Welcome, prompt, and exit messages to help the user navigate the program. The program should continue to allow selections until the program is exited. 1If a state is not found an appropriate message should be displayed. Hints: 1. Use the List data structure and associated sort() and searching capabilities 2. Create and use functions as often as possible. 3. Validate input data to ensure each entry from the user is correct before proceeding. 4. Prompt the user to reenter information as needed. 5. The following Python sites are excellent resources for learning more about the Python libraries mentioned in the readings that you should use as part of this exercise. a. https://matplotlib.org/tutorials/introductory/pyplot.html b. https://matplotlib.org/tutorials/introductory/images.html#sphx-glr-tutorialsintroductory-images-py 6. Use comments to document your code 7. Test with many combinations. 8. Use pylint to verify the code style – the goal is a 10! 9. Before you import a third part library (e.g. matplotlib) )you must install it. To install a Third Party library, you use this command at the command prompt: python -m pip install -U matplotlib2. (20 points) Document your testing results using your programming environment. You should also include and discuss your pylint results for the application. The test document should include a test table that includes the input values, the expected results and the actual results. A screen capture should be included that shows the actual test results of running each test case found in the test table. Be sure to include multiple test cases to provide full coverage for all code and for each function you develop and test. 2

$25.00 View

[SOLVED] Sdev300 – week 2 deliverables

Overview: This week, you have studied additional Python language syntax including functions The Lab for this week demonstrates your knowledge of this additional Python functionality. Submission requirements for this project include 2 files. (Zipping them into one file is acceptable and encouraged): • Python Command Line Math and Security Related Application Code • Word or PDF file containing your test and pylint results Python Applications for this Lab: (total 100 points): The first exercise produces a command line menu-driven python application providing users with the ability to perform several math and security related functions. The second part documents your testing and pylint analysis results. 1. (80 points) Create a menu-driven python application with following menu options for users to run at the command line:a. Generate Secure Password b. Calculate and Format a Percentage d. Use the Law of Cosines to calculate the leg of a triangle. e. Calculate the volume of a Right Circular Cylinder f. Exit programAs you put this menu together be sure to adhere to the following guidance and hints: 1. Create functions to be called sending in the parameters the user enters. 2. Validate input data to ensure each entry from the user is correct before proceeding. 3. Prompt the user to reenter information as needed. 4. The following Python sites are excellent resources for learning more about the string, datetime, secrets, math, and random number libraries mentioned in the readings that you should use as part of this exercise. i. https://docs.python.org/3/library/random.html ii. https://docs.python.org/3/library/secrets.html iii. https://docs.python.org/3/library/string.html iv. https://docs.python.org/3/library/datetime.html v. https://docs.python.org/3/library/math.html 5. Use comments to document your code 6. Test with many combinations. 7. Use pylint to verify the code style – the goal is a 10!Some additional guidance related to your functions created: 11. For the secure Password, you should prompt the user for the length of the password to be created, as well as the complexity (i.e. Use of Upper Case, Use of Lower Case, Use of Numbers, Use of special characters). Check out options from commercial password generators such as Norton. (https://my.norton.com/extspa/passwordmanager?path=pwd-gen). Note in a command line interface, the input and prompts are just text, so you won’t be creating a GUI, just the functionality that allows the user to enter the information needed. 2. For the percentage, consider a simple example, where the user has to enter the numerator and denominator and the number of decimal points for formatting. For example, 22, 57, 3 would yield 38.596 percent. 4. The formula for the law of cosines can be found at sites such as https://www.mathsisfun.com/algebra/trig-cosine-law.html. You want to solve for c (lower case c) in the following diagram.5. The formula for a right cylinder can be found here: https://www.mathsisfun.com/geometry/prism-vs-cylinder.html. Be sure to select right circular cylinder. 6. When exiting the program be sure to thank the user for visiting your application.2. (20 points) Document your testing results using your programming environment. You should also include and discuss your pylint results for the application. The test document should include a test table that includes the input values, the expected results and the actual results. A screen capture should be included that shows the actual test results of running each test case found in the test table. Be sure to include multiple test cases to provide full coverage for all code and for each function you develop and test.2

$25.00 View

[SOLVED] Experiment – 4

Aim: Study of Boolean algebra truth tables for Logic Gate functions using AND, OR, NAND, NOR etc. ICs.. Electronic Parts Required: (i) Power supply, 1 No : +5 V (Fix +5 V from variable voltage source if constant +5 V is not available) (ii) AND Gate: IC 7408, 1 No (iii) OR Gate: IC 7432, 1 No (iv) NOT Gate: IC 7404, 1 No (v) NAND Gate: IC 7400, 1 No (vi) NOR Gate: IC 7402, 1 No (vii) X-OR Gate: IC 7486, 1 No (viii) LED, 1 Nos (ix) Breadboard = 1 No (x) Single strand wires = 8 – 10 Nos. In most cases in digital electronics there are only two states and they are represented by two voltage bands: one near a reference value (0 Volts), and the other a value near the supply voltage (+5 Volts) and are correspond to the “false” or OFF (“0”), and “true” or ON (“1”), values of the Boolean algebra, respectively. In a standard “Boolean Expression”, the input and output information of any “Logic Gate” or circuit can be plotted into a standard table to give a visual representation of the switching function of the system. The table used to represent the “boolean expression” of a logic gate function is commonly called a Truth Table. A logic gate truth table shows each possible input combination to the gate or circuit with the resultant output depending upon the combination of these input(s). For example, consider a single 2-input logic circuit with input variables labeled as A and B. There are “four” = 22 possible input combinations of “ON” and “OFF” for the two inputs. However, when dealing with Boolean expressions and especially logic gate truth tables, we do not generally use “ON” or “OFF” but instead give them bit values which represent a logic level “1” or a logic level “0” respectively. Then the four possible combinations of A and B for a 2-input logic gate is given as: Input Combination 1. – “OFF” – “OFF” or ( 0, 0 ) Input Combination 2. – “OFF” – “ON” or ( 0, 1 ) Input Combination 3. – “ON” – “OFF” or ( 1, 0 ) Input Combination 4. – “ON” – “ON” or ( 1, 1 ) Therefore, a 3-input logic circuit would have 8 = 23 possible input combinations and a 4input logic circuit would have 16 = 24, and so on as the number of inputs increases. Then a logic circuit with “n” number of inputs would have 2n possible input combinations of both “OFF” and “ON”. In order to keep things simple to understand, we are here only dealing with simple 2-input logic gates, but the principals are still the same for gates with more inputs. I. (A) 2-input AND Gate : For a 2-input AND gate, the output Q is true if BOTH input A “AND” input B are both true, giving the Boolean Expression of: ( Q = A and B ).Note that the Boolean Expression for a two input AND gate can be written as: A.B or just simply AB without the decimal point. I. (B) ) 2-input AND Gate 7408 IC : IC 7408 has four 2-input AND gates. The figure shows the input and output of AND gates. Use Vcc as +5 Volts. The input can be defined as +5 V = 1 and 0 V = 0 states.A.B = QII. (A) 2-input OR Gate : For a 2-input OR gate, the output Q is true if EITHER input A “OR” input B is true, giving the Boolean Expression of: ( Q = A or B ).II. (B) ) 2-input OR Gate 7432 IC : IC 7432 has four 2-input OR gates. The figure shows the input and output of OR gates. Use Vcc as +5 Volts. The input can be defined as +5 V = 1 and 0 V = 0 states.A + B = QIII. (A) 2-input NOT Gate : For a single input NOT gate, the output Q is ONLY true when the input is “NOT” true, the output is the inverse or complement of the input giving the Boolean Expression of: ( Q = NOT A ).IV. (A) 2-input NAND Gate :The NAND Gates are a combination of the AND Gates with that of a NOT Gate or inverter. For a 2-input NAND gate, the output Q is False if BOTH input A and input B are true, giving the Boolean Expression of: ( Q = not(A and B) ).V. (A) 2-input NOR Gate :The NOR Gates are a combination of the OR Gates with that of a NOT Gate or inverter. For a 2input NOR gate, the output Q is true if BOTH input A and input B are NOT true, giving the Boolean Expression of: ( Q = not(A or B) ).V. (B) ) 2-input NOR Gate 7402 IC : IC 7402 has four 2-input NOR gates. The figure shows the input and output of NOR gates. Use Vcc as +5 Volts. The input can be defined as +5 V = 1 and 0 V = 0 states. A+B = QVI. (A) 2-input Ex-OR (Exclusive OR) Gate :The above logic gates are standard logic gates and there is also exist a special type of logic function called an Exclusive-OR Gate. This type of gate can be made using the above standard gates however, as this is widely used function, this is now available in standard IC form also. For a 2-input Ex-OR gate, the output Q is true if EITHER input A or if input B is true, but NOT both giving the Boolean Expression of: ( Q = (A and NOT B) or (NOT A and B) ).VI. (B) ) 2-input Ex-OR Gate 7486 IC : IC 7486 has four 2-input Ex-OR gates. The figure shows the input and output of Ex-OR gates. Use Vcc as +5 Volts. The input can be defined as +5 V = 1 and 0 V = 0 states.Boolean Algebra & Truth TablesExample – 1 : Find the truth table of the following Boolean algebra.i) You construct the above Boolean circuit and find out the output of each gate level and also at final output Q (One can test the voltage at each step with the help of a digital voltmeter). ii) Now you construct the same Boolean circuit using different ICs and show that the output follows same as Logic converter output.Example – 2 : Find the truth table of the following Boolean algebra.i) You construct the above Boolean circuit using different ICs and show that the output follows same as Logic converter output.Example – 3 : Find the truth table of the following Boolean algebra.i) You construct the below Boolean circuit using different ICs and show that the output follows same as Logic converter output.Truth Table :Sl. No A B C D Example – 1 Q Example – 2 Q Example – 3 Q 1 0 0 0 0 2 0 0 0 1 3 0 0 1 0 4 0 0 1 1 5 0 1 0 0 6 0 1 0 1 7 0 1 1 0 8 0 1 1 1 9 1 0 0 0 10 1 0 0 1 11 1 0 1 0 12 1 0 1 1 13 1 1 0 0 14 1 1 0 1 15 1 1 1 0 16 1 1 1 1***

$25.00 View

[SOLVED] Sdev300 – week 1 deliverables

Overview: In this week, you have set-up your Python Environment. The Lab for this week demonstrates your first use of this environment with a fairly simple Python application. You will also use pylint to verify your code is using professional coding style and standards. Submission requirements include 3 files. (Zipping them into one file is acceptable): • Python Voter Registration Application Code (python code) • Word or PDF file containing your test and pylint resultsPython Applications for Lab1: (total 100 points): This lab consists of two parts. The first exercise produces a voter registration application asking the user a few simple questions followed by a confirmation of registration, provided the user is eligible. The second part documents your testing and pylint analysis results. 1. Using your Python programming environment, write a Python application that supports voter registration. The application will launch and run from the command line prompt. The application will prompt the user for their first name, last name, age, country of citizenship, state of residence and zipcode. To be a valid registration all fields must be entered. If they are at least 18 years old and a U.S citizen, they can move forward and be prompted for the remaining questions and register to vote. If not, they should not be presented with the additional questions. There should be some error checking logic on the input statements to make sure the age numbers entered seem reasonable (e.g. a person is probably not > 120 years) and states should be 2 letters representing only valid U.S. States. The application should prompt the user for the needed questions to complete the registration and reprompt when data is invalid giving the user the opportunity to retry. The output should summarize the input data and congratulate the user if they are eligible to vote and entered all of the data. The user should be given options to exit the program at any time to cancel the registration process. The following is a possible application interface. Other application interfaces are possible as well. (80 points) **************************************************************** Welcome to the Python Voter Registration Application. Do you want to continue with Voter Registration? Yes. What is your first name? Sally Do you want to continue with the voter Registration? What is your last name? Smith Do you want to continue with the voter Registration? Yes What is your age? 49 Do you want to continue with the voter Registration? Yes Are you a U.S. Citizen? Yes Do you want to continue with the voter Registration? Yes What state do you live? MD Do you want to continue with the voter Registration? Yes What is your zipcode? 21012 Thanks for registering to vote. Here is the information we received: Name (first last): Sally Smith Age: 49 U.S. Citizen: Yes State: MD Zipcode: 21012 Thanks for trying the Voter Registration Application. Your voter registration card should be shipped within 3 weeks. **************************************************************** Hints: 1. Be sure to add logic to test for continuing the registration process. 2. Validate data is valid on entry (e.g. all fields have input data, age seems correct, states seem correct.) 3. Test with many combinations. For example, what happens if you enter invalid data? Exit the application at any point, or aren’t 18 years old? 4. Use comments to document your code 5. Use pylint to verify the code style – the goal is a 10! 2. Document your test results for each application within your programming environment. You should also include and discuss your pylint results for each application. The test document should include a test table that includes the input values, the expected results and the actual results. A screen capture should be included that shows the actual test results of running each test case found in the test table. Be sure to include multiple test cases to provide full coverage for all code. For example, you should demonstrate each set of logic in the code works as expected and every statement in the code is reached through the test cases. (20 points) Test Case Input Expected Output Actual Output Pass? 1a 1,2,3,4,5,6,7,8,9,10 Sum= 54, Range =9 Sum= 54, Range =9 Yes 1b 2,10,1,11,11,32,42,21,32,23 Sum= 183, Range =41 Sum= 183, Range =41 Yes 1c 3,g,e,s,7,12,e,s,x,! Error Error No input validation issue …Include the screen captures support each of the test cases. These are the screen captures validating the actual output for each test case.

$25.00 View

[SOLVED] Cs4223: multi-core architectures

Infrastructure:You can use an account on the Compute Cluster on run your experiments (a Linux-based Docker image or VM will also work). You should have automatically received SoC account when you registered for this module. If you do not have SoC account, you can enable account access here. If there are issues, please contact technical helpdesk in Level 1 COM1. Next you need to activate “SoC Compute Cluster” access through MySoC. Please follow these instructions to access the cluster.Here is a walkthough on how to start your interactive shell:user@mysyste:~$ ssh xlogin1 user@xlogin1:~$ salloc salloc: Granted job allocation 7763 user@xlogin1:~$ srun –pty bash user@xcnb0:~$ hostname xcnb0 user@xcnb0:~$ exit exit user@xlogin1:~$ exit exit salloc: Relinquishing job allocation 7763 user@xlogin1:~$You will use Simplescalar architectural simulator for your experiments. An architectural simulator models an architecture in software, executes your application and provides detailed timing information. Simplescalar simulator you will be using can execute binaries in PISA instruction set (which is very similar to MIPS and other RISC instruction sets) and can model in-order as well as out-oforder processor cores with detailed cache and branch prediction mechanisms. http://www.simplescalar.com/For your convenience SimpleScalar has been installed on the cluster. Go to /home/course/cs4223/assignments/assignment1/simplesim-3.0 You will be using sim-safe, sim-profile and sim-outorder simulators from this directory. You might need to copy the applications to your home directory to run them properly. In addition, you can find the SimpleScalar user’s guide in the assignment1 directory.You will use three SPEC95 benchmarks (compress, go, and gcc; binaries are compress95.ss, go.ss and cc1.ss) for this experiment. The pre-compiled benchmarks for PISA instruction set are available from /home/course/cs4223/assignments/assignment1/benchmarks Feel free to copy this entire directory to your own home directory on the cluster. Also see the README file in the benchmarks directory to see how to run these files. Before running SimpleScalar, please export environment variable as below: $ export PATH=$PATH:/home/course/cs4223/assignments/assignment1/simplesim-3.0First follow the instructions in the README file in CS4223 directory to run each benchmark using sim-safe simulator and check the correctness of the output. sim-safe is a functional simulator which simply executes the benchmark but does not model the micro-architecture and hence cannot provide any timing information.The benchmark you choose depends on your student ID as follows: Student ID modulo 3 = 0: Choose compress Student ID modulo 3 = 1: Choose go Student ID modulo 3 = 2: Choose gccTo make the simulation time more fair between benchmarks, please first validate that your benchmark is running correctly (See the README in the benchmark directory to compare simulation output). When verified, one can use the first 80M instructions (SimpleScalar option -max:inst 80000000) to speed up development.Design Problem:When designing a processor you have to make trade-offs in order to achieve the best performance for a given cost. Choose one benchmark and optimize for this chosen benchmark your configuration of the pipeline functional units, pipeline width etc. using chip area as the cost of interest according to the table below.Resource Area Values Pipeline width W 1.8 x W 1-4 Integer ALU 2 1-4 Integer Multiplier 3 1-4 FP ALU 4 1-4 FP Multiplier 5 1-4 Out-of-order issue 1.4 x (above area) Yes, No Reorder Buffer (RUU) 0.5xRUU 8,16,32 Load/Store Queue (LSQ) 0.5xLSQ 4,8,16Note that area estimates are gross approximations and that they do vary widely with the technology used to implement the chip. Using the table, you can calculate the area of your design by just adding the contributions from the units. For example a design with a pipeline width of 2, 4 integer ALUs, 1 integer multiplier, 1 floating point ALU, 1 floating point multiplier would require an area of (2*1.8 + 4*2 + 3 + 4 + 5) = 23.6 for the first 5 rows. With out-of-order execution, 8 RUU and 4 LSQ would require 23.6 x 1.4 + 4 + 2 = 39.04 unit area. For in-order processor, the last three rows will contribute to zero area.Clearly, if you choose the maximum value of each parameter you get the best performance (IPC). But the area requirement might be too high.You will be now using sim-outorder simulators for the rest of this assignment. To understand the meaning of the different configuration choices please read SimpleScalar user-guide available from https://web.archive.org/web/20200728131520/http://www.simplescalar.com/docs/ users_guide_v2.pdfUse the default configuration for sim-outorder given in default.cfg file in CS4223 directory and modify the pipeline parameters. Note that you can use the simoutorder simulator to model in-order processor by setting issue:inorder to true.(A) Design the best performing architecture under the constraint that the area is less than or equal to 60. Use simulations both to guide your design and verify your results. Note that simulating all possible reasonable configurations would take several hundreds of simulations, which is not realistic. You need a smart mechanism to navigate the design space.(B) Now assume that the power consumption for your architecture is proportional to the total area. For example, the power consumption for the processor with 39.04 unit area is 39.04 watt. Therefore, performance per watt for this architecture will be IPC/watt. Design the architecture with best performance per watt value (higher is better) under the constraint that the area is less than or equal to 60.(C) After you get your optimal design point in terms of performance (as in Question (A)) you need configure the size of the L1 instruction and data caches. In the default.cfg you can see the parameter ‘–cache:dl1’ and ‘– cache:il1’ with the same configuration value ‘128:64:1:1’. (You could find the meaning of each number in the SimpleScalar user-guide.) Essentially the default configuration is 64-byte block size and 128 sets in a direct-mapped cache. We would like to keep the block size constant at 64-byte and associativity equal to 1, that is, direct-mapped cache. But our objective is to coordinate L1 instruction cache size and L1 data cache size to improve the IPC. The choices for number of cache sets are given below in the table. Your goal is to find the optimal design point (best IPC) among these choices.Choice number 1 2 3 4 5 6 7 L1 ICache # of sets 1024 512 256 128 64 32 16 L1 DCache # of sets 16 32 64 128 256 512 1024Your report should not exceed 5 pages. The key points you should mention are the bottlenecks in the pipeline, how you identify them, and how you overcome them through your design choices. Please provide an introduction to this assignment, and an overview of the completed tasks and results as an introduction section (also include a short conclusion after you describe your results). Describe your optimal design point, the process you employed to reach this design point and the configuration of L1 cache. Note that your comprehension of the architecture and your interpretation of the experimental results for different design choices are far more important than reaching the “optimal” design point.• Upload your report to Luminus Files / Submissions / Assignment 1 – ILP.Grading Criteria:1. Optimal Pipeline Configuration: 8 Points 2. Optimal Performance/Watt Configuration: 4 Points 3. Optimal Cache Configuration: 4 Points 4. Report and Analysis: 4 PointsSIMULATION TAKES TIME. START EARLY.Runtime Examples (single run) ==> sim-safe-compress.time sim-profile-compress.time sim-outorder-compress.time

$25.00 View

[SOLVED] Cs382 –

CS 382 Computer ArchitectureIn this lab, we are going to use Logisim-Evolution to build an adder and a multiplexor. 1 Task 1: Nibble Adder In class and textbook Chapter 3.1.2.3, we showed a basic one-bit adder, which adds two bits with carry-in flag, and produce a carry-out flag. In this task, you will need to extend this to a nibble adder to add two nibbles together, and of course, produce a result nibble, and a carry-out flag. A relevant example in textbook is a double-word adder (see Figure 3.8). 2 Task 2: 2-Way Nibble Multiplexor The second task is to build a multiplexor that can choose between two nibbles. Since we have two inputs, we only need one bit of control signal. You can follow Figure 3.6 in the textbook. 3 Testing Your Circuits To test the circuits, we provide you two test vector files. They enumerate all the possible input as binary as well as the output. On the top menu (or menu bar), choose Simulate, and Test Vector…, and load the corresponding test vector files. Note that the files will work only when you have the correct labels, so do no change the labels – we use the same vector files for grading. 4 Requirements The requirements apply to both tasks. You must download the starter file, and write your name and pledge in the .circ files; You must not change anything in the test vector files; You must only use basic gates from the Gates menu. Logisim-Evolution does provide existing components such as multiplexor and adder, but you must not use them. 5 Grading The lab will be graded based on a total of 10 points, 5 for task 1 and 5 for task 2. The following lists deductibles, and the lowest score is 0 – no negative scores: Task 1: • -5: used existing adder provided by Logisim; • -5: if 70% to 100% cases in the test vector file have failed; • -3: if 30% to 69% cases in the test vector file have failed; • -1: if >0% to 29% cases in the test vector file have failed; • -1: no pledge and/or name. 1 Task 2: • -5: used existing multiplexor provided by Logisim; • -5: if 70% to 100% cases in the test vector file have failed; • -3: if 30% to 69% cases in the test vector file have failed; • -1: if >0% to 29% cases in the test vector file have failed; • -1: no pledge and/or name. Attendance: check off at the end of the lab to get attendance credit.2

$25.00 View

[SOLVED] Cs382 –

CS 382 Computer ArchitectureIn this homework, we’re going to implement control structures using goto statements. Even though goto is not something you should use normally in C programming, we use it here as a tool to get familiar with un-structured programs, which will benefit our upcoming assembly language learning. 1 Task 1 (20 pts): Copy a String In this task, you will write a C code to implement a function called copy_str() that copies all the characters in the src string to dst string. The prototype of the function is declared as follows:goto if You can assume dst has enough space to store all the characters from src . Note, you cannot use any type of structured loops, such as for , while , and do…while , meaning the only option you can use is statement. Of course you can use if-else structure when needed; however, no statement is allowed in or else if or else blocks other than a single goto . Requirements You must not use structured loops mentioned above; You must not include any other headers; You must not use any functions provided in string.h , especially not strcpy() and strlen() . Note that your code does not need to calculate string length. 2 Task 2 (30 pts): Calculate Dot Product In this task, you need to write a C function to calculate the dot product between two vectors. The prototype of the function is declared as follows:where both vec_a and vec_b are integer vectors that contain length number of integers, and the function will return a single integer as the dot product. size_elem is the number of bytes of each element in the vectors. Note that even though both vectors contain integer values, we do not pass int* . In your implementation, you must not cast the entire vector back to int* . However, casting one element to int* is allowed. As in the previous task, you are not allowed to use loops, so you’d have to use goto statements. Similarly, no statement is allowed in if or else if or else blocks other than a single goto . Requirements You must not use structured loops mentioned above; You must not cast the entire array into another type; only casting one address to int* at a time is allowed.3 Task 3 (50 pts): Sorting Nibbles In this task, you’ll write a C function to sort all the nibbles (4 bits) in an integer array. The prototype of the function is declared as follows:where arr is the integer array, while length is the number of integers in that array. For example, say we have an integer array: int arr[3] = {0x12BFDA09, 0x9089CDBA, 0x56788910} . One nibble has 4 bits, so each hexadecimal digit represents a nibble. If we treat them as individual numbers and sort them from smallest to largest and print them out as integers, we have: 0x00011256 0x78889999 0xAABBCDDF . You can use any sorting algorithm you like, but do not use functions provided by existing libraries such as qsort() . Hints Take a deep breath before you start Ë! The first step you want to do in your code is to separate all the nibbles in that array. Even though each nibble takes only four bits, you can still store one nibble in a char variable. If the array is like this: int arr[2] = {0x1234, 0x4321} you can use bit-wise operations and shifting to create an array like this: char nibs[16] = {0,0,0,0,1,2,3,4,0,0,0,0,4,3,2,1} . Note how many 0 are there in nibs : each integer takes four bytes which is eight nibbles, so you need to make sure leading zeros are also considered in the array; After sorting array nibs , you just need to re-group nibbles back into integers, and replace them back to arr . Note the function performs an in-place sorting; 10 bonus points if you use goto in your code instead of structured loops. Requirements You must not use existing libraries to sort; Write down the sorting algorithm you chose in the comments; In the comments state if you’d like to be graded for bonus points. Without the statement no bonus points will be given. 4 Starter Code & Tester You are also provided with a starter code where you can see how to call and test the functions. However, note that passing the demo test in the starter code does not mean your program is entirely correct. You must come up with your own tests, especially edge cases. To help you with testing, we also provided a tester file tester_m1 (or tester_x86 , depending on your machine type). Put this tester file in the same directory as your C code, and use the following command to generate an executable:assuming the C file you wrote is called main.c . If there’s no errors reported, you can go ahead and run the tester:where the name indicates the task you want to test, or all to test all three tasks. 5 General Requirements In addition to each task’s requirements listed above, here are additional requirements applied to all tasks: Your code must be able to compile successfully and execute without segmentation fault or any other type errors; You must not change any function prototypes; You must not include any other header files other than stdio.h ; You must not use any other library functions; it’s ok to create your own helper functions, though; Comment your code well – describe what your code does. Meaningless comments and/or comment-less code will be penalized; 6 Grading The homework will be graded based on a total of 100 points. Task 1 (20 pts): 5 test cases in total, 4 points each; Task 2 (30 pts): 10 test cases in total, 3 points each; Task 3 (50 pts): 10 test cases in total, 5 points each.After accumulating points from the testing above, we will inspect your code and apply deductibles listed below. The lowest score is 0, so no negative scores: Task 1 (20 pts): • -20: used structured loops or switch ; • -20: if-else blocks contain non- goto statements; • -20: used any functions from string.h ; • -20: function prototype was changed; Task 2 (30 pts): • -30: function prototype was changed; • -20: used structured loops or switch ; • -20: if-else blocks contain non- goto statements; • -10: didn’t use parameter size_elem (e.g., hardcoded integer size); Task 3 (50 pts): • -50: changed function prototype; • -40: used any sorting functions instead of implementing; • -5: didn’t state the sorting algorithm in comments; • +10: didn’t use structured loop, and stated in the comments. General (only deduct once): • -100: the code does not compile, or executes with run-time error; • -10: no pledge and/or name in C file.

$25.00 View

[SOLVED] Cs3220 lab #6 : on-chip communication protocols

100 pts in total, will be rescaled into 11.25% of your final score of the course. Part 1: AXI-Stream FIFO: 40 pts Part 2: AXI4 RAM: 60 pts + 10 bonus pts Submission ddl: Nov 19th In this lab, you will delve into the robust and scalable on-chip communication protocol, AXI4, along with its streaming variant, AXI-Stream. The objective is to design and implement FIFOs/RAMs that leverage these two protocols for content reading and writing. While the previous lab focused on a straightforward register-based communication protocol for data exchange between the CPU and ALU, it lacked the scalability and robustness required for intricate communication scenarios. Such scenarios might involve more advanced modules, like a systolic array. Building on the knowledge gained in this assignment, the subsequent lab will guide you in utilizing the FIFOs/RAMs you’ve crafted to interconnect components within a sophisticated heterogeneous system. Part 1: AXI-Stream FIFO: In this section, you’ll finish the implementation of an AXI-Stream FIFO. Please also refer to the FAQ section for more design references. For the FIFO part, there are two pointers corresponding to the read and write actions, respectively. * Each time the FIFO is read, the read pointer will be incremented by 1. * Each time the FIFO is written, the write pointer will be incremented by 1. * The read and write pointers are intentionally defined one bit wider than the bits needed to represent the FIFO address. * This is to avoid the ambiguous case for empty and full FIFOs. * Thus, when the FIFO is empty, the read pointer will be equal to the write pointer. When the FIFO is full, the 1st bit of the read and write pointers need to be different (They are in different wrap-around positions), while the rest of the bits are the same. * For better robustness, the pointer binary code is converted to gray code: ptr = ptr ^ (ptr >> 1). * The full and empty case will be conditioned on the gray code instead. * Note: Following the above logic, you need to come up with new logic to decide the full and empty case. The code skeleton is provided in axis_data_fifo.v. Finish all the TODOs in the code. To test your implementation, run the following command: make axis_data_fifo The test script is based on the testbench provided in tb_axis_fifo.v. Part 2: AXI4 RAM (60 points + 10 bonus pts) AXI-stream can only support accesses with a set of regular and consecutive addresses, which is limited in many applications. To support more general accesses, we need to use AXI4 protocol. In this section, you’ll finish the implementation of an AXI4 RAM. Please also refer to the FAQ section for more design references. Mostly, you will deal with managing the ready/valid signals and the transition among different read/write states. RAM interfaces have been handled for you. The code skeleton is provided in axi4_ram.v. Finish all the TODOs in the code. To test your implementation, run the following command: make axi4_ram The test script is based on the testbench provided in tb_axi4_ram.v. Bonus: AXI4 RAM Burst Mode (10 points) In this section, you’ll modify the implementation of an AXI4 RAM to supports burst mode. We provide a new code skeleton in axi4_ram_burst.v. Please combine with your previous parts implementation to finish all the TODOs in the code. You code should still pass the previous tests on nonburst mode. Here are also some useful links for you: + https://www.youtube.com/watch?v=ydSy7uO60Is + https://www.youtube.com/watch?v=_twa6kY-ors + https://www.youtube.com/watch?v=ZDNOezaQ4Fk + https://www.youtube.com/watch?v=lI5Gh-1zk-s To test your implementation, run the following commands: make axi4_ram_burst make axi4_ram_burst_on_non_burst Submission Provide a zip file containing your source code. Generate the submission.zip file using the command make submit. Avoid manual zip file creation to prevent any issues with the autograding script, which could lead to a 30% score deduction. FAQ [Q] Useful links to refer to for AXI4 design? [A] Official AXI4 specification: link1 link2; Handy timing diagrams from Xilinx: link3;

$25.00 View

[SOLVED] Cs3220 – lab 0 rtl getting started

Objective: The main purpose of this lab, along with the succeeding one, is to acquaint you with RTL programming, specifically Verilog. These initial steps aim to equip you with a strong foundation in Verilog, setting the stage for more advanced labs ahead. Description: This lab involves the implementation of a variety of basic hardware modules using Verilog. In addition, you will be tasked with developing the requisite testbench code to verify the correctness of your modules. This dual approach not only provides hands-on experience with Verilog but also emphasizes the importance of testing and validation in hardware design. 1. Included modules: a. Combinational Circuits; b. Vector Signals; c. Module Hierarchy; d. Always Block & Sequential Circuits 2. Specification about each modules: 3. Combinational Circuits 4. Vector Signals 5. Module Hierarchy 6. Always Block & Sequential Circuits 7. Finite State Machine Submission Format: 1. We use Gradescope for the code submission and grading. 2. Please submit the completed “submission.v” file for each module to the corresponding assignment in Gradescope. DO NOT CHANGE THE FILENAME AND MODULENAME! 1. If you pass the test cases. 2. Note: All test cases are randomly generated for all modules. 3. Partial grading Policy: Only module 3 has partial grading, where there is a checkpoint for the submodule design. FAQ: [Q] How to debug the code? [A] The gradescope will provide the input and output for both your code and the golden code if the test failed. You can compare the output to debug your code. Additionally, writing testbench is an important skill in processor design, you can also design your own testbench and install iverilog on your computer to debug the code. [Q] Any online tutorials to watch? [A] link1: Focus on the concept and programing as we will use different devices link2: modelsim (similar to vivado xsim) link3, link4: more comprehensive digital design and RTL programing tutorial videos

$25.00 View

[SOLVED] Cs4243 –

InstructionsPlease Hand In to Canvas > Assignments > Assignment1: • A report with your answers and visualizations of the image outputs embedded in the report. Name your report Assignment1Report_AXXX.pdf where AXXX is your student number. • Your source code in the form of a python notebook and intermediate and final image files a .zip named Assignment1Code_AXXX.zip, where AXXX is your student number.Part 1: Consider the corrupted image (corrupted.png) in Fig. 1(a).(a) corrupted image (b) recovered enhanced image (c) person crop Figure 1. Image Samples for Part 1. 2. Consider the crop (crop.png) of Fig. 1(c). Are you able to segment the person with the trolley from the background with simple thresholding? If so, which threshold should you use and how did you obtain this threshold? If not, describe why. Support your answer with visualized outputs. (1 mark)Part 2: Consider the image of the tile mosaic (FranklinMascot.jpg) in Fig. 2(a).(a) original tile mosaic image (b) red to green conversion (c) sample mask image Figure 2. Image Samples for Part 2Hints: Consider different variants of superpixelling and Hough transform. Select your search scope and loops wisely for computational efficiency.

$25.00 View

[SOLVED] Cs 382 project 2 user manual

Breona Pizzuta and Ben Carpenter Group 32 on Canvas “I pledge my honor that I have abided by the Stevens Honor System” 1. Introduction CPU Name: Shudong-INATOR Job Description: Ben: Worked mainly on the CPU architecture and various testing. Helped Breona with the debugging of code to get it to run properly. Breona: Worked mainly on writing the code and writing the User Manual. Helped Ben fix errors within the CPU. Overall we worked on most sections of the project at the same time, together in a collaborative environment. 2. Assembling Instructions How to use your assembler program (e.g., what command, what library to link, etc), and how to load it to the instruction and/or data memory: Running the Assembler: To assemble an assembly program into a machine code memory image: – Create a .txt file – use a .data section to define any variables in binary in this format: – variableName: 01 – use a .text section to write your instructions – Instruction format shown in section 4. – Save your Shudong-INATOR assembly code in a .txt file, named instructions.txt – Open a terminal or command prompt. – Run the assembler program: python assembler.py instructions.txt The program will output two files: – code_image.txt: Contains the hexadecimal representation of the instructions (machine code) for the .text section. – data_image.txt: Contains the hexadecimal representation of the initialized data for the .data section. Loading Memory Images – To use the image files they need to be stored in the correct RAM. – Instruction Memory (code_image.txt): Load this file into the CPU’s instruction memory. – Data Memory (data_image.txt): Load this file into the CPU’s data memory.43. CPU Architecture The Architecture description of your CPU, e.g., how many general purpose registers and how can we refer them in an assembly program, what functions your CPU can do, etc: Overview: Our CPU is composed of a PC, Instruction_Memory, Instruction Splitter, Control Unit, Register File, ALU, and Data_Memory. This is shown below:PC: Used to move through the instructions.Instruction_Memory: Holds the instructions. 16 bits per instruction or 4 hex digits long.Instruction Splitter: It takes the 4-hexadecimal-digit instruction and splits it into two bits for the opcode to determine the operation, two bits for the target register (TargetReg), two bits for the first register called in the instructions (Rn), two bits for the second register on the instructions (Rm), and an immediate number of 8 bits (imm8). We use the second register for ADD and SUB, and the immediate number is used for LDR and STR.(ignore the mess of wires) Control Unit: The control unit translates the opcode to determine what operation we will be performing. This will determine whether or not we use the ALU. The opcode for each instruction type is as follows: 00: Load (LDR) 01: Store (STR) 10: Subtract (SUB) 11: Add (ADD) The outputs used here are: MemToReg, MemRead, MemWrite, ALUsrc, ALUop, RegWrite and Reg2Loc. The table below shows the outputs used to execute each instruction:LDR STR ADD SUB Reg2Loc 0 for Rm or 1 for Rt 1 1 0 0 RegWrite Writes data to register 1 0 1 1 ALUop Opcode for + (0) or – (1) 0 0 0 1 ALUsrc imm or second reg 1 1 0 0 MemWrite Writes data to memory 0 1 0 0 MemRead Reading from memory 1 0 0 0 MemToReg Deciding if you take calculate from ALU (0) or ReadDatam (1) 1 0 0 0 Extra bit 0 as a buffer to get an even 8 bits 0 0 0 0 Full Opcode Full output for each 11010110 10011000 01000000 01100000Register File: Four General-Purpose Registers – The register file holds the registers X0-X3 which store data for reading and writing – The CPU contains 4 general-purpose registers, referred to as X0, X1, X2, and X3. – Registers can be used as sources or destinations in instructions.ALU: The Arithmetic Logic Unit, or ALU does the computations for the instructions ADD and SUB. In the ALU, ADD is represented as 0 and SUB is represented as 1.Data_Memory: The Data Memory is used when we use the instruction LDR to load from memory or when we use the instruction STR to write/store in memory.4. Instruction Format For each instruction implemented, write the general format (such as ADD Rm,Rn,Rt ), and its binary encoding. You can follow a similar description as in Chapter 3.2 in textbook. When describing binary encoding, you need to specify why you need this number of bits for that field Each instruction follows the format: Opcode (2 bits) + Target Register (Rd) (2 bits) + Source Register 1 (Rn) (2 bits) + Source Register 2 (2 bits) + Immediate (Rm/Imm) (8 bits) Supported Instructions – ADD: Adds two register values, Rn and Rm and stores the result in a destination register Rd. – ADD Rd, Rn, Rm – Binary encoding: 01000000 – SUB: Subtracts one register value (Rn) from another (Rm) and stores the result in a destination register (Rd). – SUB Rd, Rn, Rm – Binary encoding: 01100000 – LDR: Loads a value from memory from location (Rn) and Offset of Imm8 into a register (Rd). – LDR Rd, [Rn, Imm8] – Binary encoding: 11010110 – STR: Stores the value of a register (Rd) at a memory location (Rn) with a specified offset of Imm8. – STR Rd, [Rn, Imm8] – Binary encoding: 10011000 Why This Number of Bits? – Opcode (2 bits): Allows for up to 4 instructions, sufficient for this CPU design. – Registers (2 bits): Addresses up to 4 general-purpose registers. – Immediate (8 bits): Supports values between 0–256, sufficient for simple programs.5. Demo ProgramThis program just quickly samples several of the different functionalities of the CPU, including every unique instruction, utilizing multiple registers, and using the same register multiple times in one instruction. 6. Extra Credit We completed two extra credit assignments: – Making your assembler recognize data and text segment so it can generate two image files. They will be loaded into instruction and data memory separately – Adding extra fun components, such as LED display to show calculation results. Shudong-INATOR Page

$25.00 View

[SOLVED] Cs382 –

CS 382 Computer ArchitectureContents 1 Background 1 1.1 Examples 2 1.2 Assumptions 2 2 Description 3 2.1 Task 1 (30 pts): Number to ASCII 3 2.2 Task 2 (30 pts): Returning a String of Numbers 3 2.3 Task 3 (30 pts): Counting Specifiers 3 2.4 Task 4 (10 pts): Mingle and Pringle! 4 2.5 Extra Credits (20 pts) 4 3 Testing 4 3.1 Individual Tests 4 3.2 Tester 5 4 Grading 6 4.1 General Requirements 6 4.2 Rubrics 6 4.3 Early Bird Extra Credits 7 Appendix A Register Tracking (Very Important) 8This is an individual project. This project is designed to challenge you to be better. That being said, this is a difficult project, so please start early. Even though you should do your best to finish the project, we understand that some of you might not be able to, and it’s totally ok! That’s why we put more points on the basic tasks. 1 Background In C language, when we want to print a variable out, we can simply use printf() . However, if we want to print an array out, that wouldn’t be as easy as in Python, and we will have to use a loop to print each element individually. You, an ambitious and talented CS-382 student, decided to make a revolution on C language by providing a new function that can print an array out with just one call. To play a twist on printf() , you call this function pringle() . We declare pringle() function as follows: 1 unsigned long int pringle(char*, …); This is very similar to printf() , where the first parameter is always a string that contains zero or more format specifiers (such as %d). The rest of the parameters are denoted as … , meaning it can have any number and any type of parameters. In case you’re wondering, this is called variadic function. Implementing this in C involves new knowledge and is not the purpose of this project. However, using all we have learned so far, we can easily implement this in assembly. 1.1 Examples Let’s first see some examples of what this function can do. Assume we have the following code in C:where %a is the specifier for our pringle() function. The output will look like this:As you see from the examples above, one specifier %a corresponds to two parameters: the array pointer, and the length of the array:1.2 Assumptions To make sure you understand the main points of the project without getting tangled in too much details, we make the following assumptions throughout the project: (1) We will only work on unsigned long int arrays; (2) The maximal number of %a in one pringle() call is 3 (see extra credits); (3) The number of arrays passed to pringle() always matches the number of %a’s in the string; (4) The maximal length of outputted string is the number used in the starter code; (5) No need for error checking. For example, the array length is always correct. We split the project into four smaller parts, and grade them individually to maximize your points. Each task will be the building block of a complete pringle() function. Please write each task with correct calling conventions from the beginning, because it’ll save you a lot of time, headache, and tears when you put them together. 2 Description 2.1 Task 1 (30 pts): Number to ASCII Let’s start with the smallest task — convert an integer to ASCII, the opposite operation of the one you wrote in homework 2. In this task, you can assume all the numbers are unsigned so no need to consider negative numbers. The function is declared as follows:2.2 Task 2 (30 pts): Returning a String of Numbers The procedure of is declared as follows:This procedure will concatenate all the elements in an array pointed by arr of length len , and return the pointer to this new string. For example, the following callwith a space between every two numbers (without newline at the end). To simplify implementation, you can certainly have an additional space after the last number. Note that this function will use a loop and call itoascii() on each number. Also, it is highly recommended that you clear out the string in .data segment before you do anything in this procedure. 2.3 Task 3 (30 pts): Counting Specifiers Because pringle() is variadic, there’s uncertain number of parameters, and it’ll be difficult to retrieve them from registers/stack. However, in our project, the first parameter is always a string with a certain number of format specifiers (%a). Thus, we can first count the numbers of specifiers in the string and to know how many parameters. Note that one %a needs two parameters: the pointer to the array, and the length of the array. This procedure is declared as follows:where the function will return the number of %a’s in str . 2.4 Task 4 (10 pts): Mingle and Pringle! Last task is to complete pringle() function. After completing the three tasks above, you’ll see the algorithm is very simple: (1) Scan every character in the string; (a) If there’s a %a: i. Fetch the corresponding array pointer and its length; ii. Call concat_array() ; iii. Copy the return of concat_array() into the destination string; (b) Else copy the character from the pringle() parameter to the destination string; (2) Return the number of characters printed (excluding null terminator). We use the following flowchart to visualize the execution of pringle() function. “Array is: %a ” unsigned long int arr[] = {10, 20, 30};2.5 Extra Credits (20 pts) If it’s not challenging enough for you, an obvious opportunity to earn extra credits is to remove the limit of parameters we can pass to pringle() function. We will grade this part manually. Please indicate if you want to be graded for EC at the top of pringle.s as a comment. 3 Testing Another skill you will gain from this project is to link your C code with assembly code. From a practical aspect, for some functions the compiler cannot produce the most efficient assembly code, and that’s where you, a radical and intelligent CS-382 student, rise and shine! You can implement the function in assembly, and call the function from your C code directly. 3.1 Individual Tests The first test file we provide is indietest.c . From this file, you can see how we declare functions written in assembly, and how to call them. First of all, we declare those functions as extern , since they’re only defined during the linking phase: 1 extern char* itoascii(unsigned long int); 2 extern char* concat_array(unsigned long int*, unsigned long int); 3 extern unsigned long int count_specs(char*);If you have finished task 1 and want to test it only, you can comment out the code for task 2, 3, and 4, and run the following commands to compile:This file can be used as an example showing you how we call and test your functions in the tester, introduced below. 3.2 Tester Ah, the (in)famous tester again! We highly recommend you use indietest.c first to make sure it’s working before using the tester. The usage of the tester is the same as in previous two homework. Put this tester file in the same directory as your assembly code, and go ahead and run the tester:4 Grading 4.1 General Requirements Each procedure should be written in the file of the same name. For example, itoascii() should be written in the file called itoascii.s . If a helper function is used, please do not create any new file – just write it in the file where it’s used; If you need to declare any global variable, feel free to declare it in the .data segment (if any), or just declare a new .data segment in the file it’s used; If there’s already some data declared in the starter file, please do not change it, and use the label to store your result; • Comment every line of your code (except the lines to exit your program): do not just describe what the instruction does (we all know what it does), but how it’s related to your algorithm. For example, we all know that MOV X0,0 is to move 0 to X0, but a more appropriate comment should look like, “Initializing the index”; • Use gdb first: if there’s a segmentation fault, find out which line caused this. If you are not getting correct value, find out which instruction is not getting the correct value, and what your expected value is; • Fill in the table in the appendix (see last part): because the project is very large and the register use can be very messy, we ask you to keep track of your register use in the table, so that our CAs can understand your program faster and easily. In general you need to provide three things: your code, gdb result, and register table. Missing any of them will significantly delay our response. We enforce this requirement to make sure everyone’s time — yours, the CAs’, all other students’ — are well utilized and respected. Thank you for your understanding and cooperation. 4.2 Rubrics The project will be graded based on a total of 100 points. Task 1 (30 pts): 10 test cases in total, 3 points each; Task 2 (30 pts): 10 test cases in total, 3 points each; Task 3 (30 pts): 10 test cases in total, 3 points each; Task 4 (10 pts): 5 test cases in total, 2 points each.After accumulating points from the testing above, we will inspect your code and apply deductibles listed below. The lowest score is 0, so no negative scores. Task 1 – 3 (30 pts each): • -30: the code does not compile, or executes with run-time error; • -30: the code is generated by compiler or AI; • -30: the code cannot be explained clearly in person; • -30: used any external libraries and/or functions (e.g., printf() ); • -30: concat_array() did not call itoascii() ; • -20: not managing stack frames and/or not following calling conventions, including self-defined helper functions if any; • -5: no pledge and/or name in assembly file; Task 4 (10 pts): • -10: the code does not compile, or executes with run-time error; • -10: the code is generated by compiler or AI; • -10: the code cannot be explained clearly in person; • -10: used any external libraries and/or functions (e.g., printf() ); • -10: pringle() did not call concat_array() ; • -8: not managing stack frames and/or not following calling conventions, including self-defined helper functions if any; • -1: no pledge and/or name in assembly file; 4.3 Early Bird Extra Credits Deliverable Only submit four files: itoascii.s , concat_array.s , count_specs.s , and pringle.s . No need to zip. Note: if you resubmit, please resubmit ALL files. Appendix A Register Tracking (Very Important) The main goal of this project is to let you understand calling conventions in assembly. As you’ll write a lot of procedures and also call them, it becomes extremely difficult to debug (and write code) if you don’t follow the convention from the start. In the following, we provide a worksheet to plan your register use, from task 1 to task 4. When you finish a task, make sure it works first using the indietest.c we provide, and immediately fill in the table below to keep track of all the registers you used/modified. Then when you move on to the next task, you’ll have an idea which registers you need to save on the stack, and which register do not. Registers Task 1 itoascii() Task 2 concat_array() Task 3 count_specs() Task 4 pringle() X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 X21 X22 X23 X24 X25 X26 X27 X28 X29 X30

$25.00 View