Please follow exactly what is ask, otherwise I wont get the credit. (NO LIBRARY FUNCTIONS) It is…

Please follow exactly what is ask, otherwise I wont get the credit. (NO LIBRARY FUNCTIONS) It is important to note that you are not allowed to use library functions, you need to write the necessary functions to implement those. , I want you to assume char takes 1 byte, and String takes 1*length. regarding Color, you can consider it as a 32-bit sequence. Alpha + Red + Blue + Green Let say Color object is created as color= new Color(255,0,0) – means that Red is 255 (0xFF), Blue (0x00) and Green (0x00). So, there is no blue and green in the color, so it is a pure red CS 351
Please follow exactly what is ask, otherwise I wont get the credit. (NO LIBRARY FUNCTIONS) It is important to note that you are not allowed to use library functions, you need to write the necessary functions to implement those. , I want you to assume char takes 1 byte, and String takes 1*length. regarding Color, you can consider it as a 32-bit sequence. Alpha + Red + Blue + Green Let say Color object is created as color= new Color(255,0,0) – means that Red is 255 (0xFF), Blue (0x00) and Green (0x00). So, there is no blue and green in the color, so it is a pure red CS 351 Computer Architecture I Jan 17, 2020 Assignment-1 1 Instructor: Dr.Fatma C Serce Due Date: January 31, 2020 A Simple Main Memory Implementation In this assignment, you are asked to design and develop a main memory of a simple CPU. You are given an interface class, MemoryInterface, which gives the abstraction of main memory. You are asked to create a class, MainMemory, which implements MemoryInterface. public interface MemoryInterface { // load the memory with sample data given in input file // after main memory is loaded, it will print its content to the console public void loadMemory(String inputFile) throws FileNotFoundException; // set memory[address] = data if address is valid, otherwise throw exception public void writeByte(int address, byte data) throws SecurityException; public void writeShort(int address, short data) throws SecurityException; public void writeInt(int address, int data) throws SecurityException; public void writeDouble(int address, double data) throws SecurityException; public void writeChar(int address, char data)throws SecurityException; public void writeString(int address, String data)throws SecurityException; public void writeColor(int address, Color data)throws SecurityException; // return memory[address] if address is valid, otherwise throw exception public byte readByte(int address)throws SecurityException; public short readShort(int address)throws SecurityException; public int readInt(int address)throws SecurityException; public double readDouble(int address)throws SecurityException; public char readChar(int address)throws SecurityException; //updated public String readString(int address, int length)throws SecurityException; public Color readColor(int address)throws SecurityException; } Here are assumptions and requirements for implementing main memory: MainMemory is an array of bytes and index of an array element represents the address of each byte in the memory Assume that memory is byte-aligned MainMemory object is constructed by setting the initial byte capacity, size of memory in bytes. MainMemory provides implementation for all the methods provided in the MethodInterface. The core functions of MainMemory are: o Load: initializes the content of main memory from an input file o Write: writes the data into a memory address o Read: reads the data from a memory address Important: While performing conversions, you are NOT allowed to use library classes and/or methods. You are supposed to design and develop the algorithms to make the necessary conversions. You are also provided with a Junit Test Case in the Appendix. You can add more test cases and test your implementation. CS 351 Computer Architecture I Jan 17, 2020 Assignment-1 2 Sample input file that might be used to initialize the contents of the main memory. Each line represents one byte. 11101001 00000000 01111000 00000000 00000000 00000000 00100010 00000000 00000000 00000000 00000000 00000000 00000000 00000100 11010010 01000010 10101010 01000000 00000000 00000000 00000000 00000000 00000000 01100110 01000011 01010011 00000000 11001000 01100100 00110010 CS 351 Computer Architecture I Jan 17, 2020 Assignment-1 3 HOW TO SUBMIT You are supposed to submit only MainMemory implementation via CANVAS and codepost. Please use the following file format while naming the zip file: LastNameFirstnameX_Y.zip where LastNameFirstname is your last name with the first letter in capital, followed by your first name with the first letter in capital; the X is the course code; the Y is the assignment #. (ex: SerceFatmaCS351_1.zip) HOW TO EVALUATE: The following rubric describes how your work will be evaluated. Correctness (90 points) [90] Program is correct in object oriented design and function; meets specification; and utilizes heap memory well [75] Program output is correct but elements of specification missing, e.g. variable/method declarations. [45] Part of the specification has been implemented, e.g. one out of two required subprograms. [20] Program has elements of correct code but does not assemble/compile. Readability (10 points) [10] Programmer name and assignment present. Sufficient comments to illustrate program logic. Well-chosen identifiers. [7] Programmer name present, most sections have comments. Fair choice of identifiers [5] Few comments, non-meaningful identifiers [0] No programmer name. No comments. Poor identifiers CS 351 Computer Architecture I Jan 17, 2020 Assignment-1 4 Appendix: @Test public void testReadString() { String expected = “CS”; String actual = mem.readString(24,2); assertEquals(expected, actual); } CS 351 Computer Architecture I Jan 17, 2020 Assignment-1 5 @Test public void testReadColor() { Color expected = new Color(200, 100, 50); Color actual = mem.readColor(26); assertEquals(expected, actual); } @Test public void testWriteByte() { byte data = -23; int address = 0; mem.writeByte(address, data); byte expected = -23; byte actual = mem.readByte(address); assertEquals(expected, actual); } // more test cases for write operations }

Custom Paper Help
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.