Computer architecture

Computer architecture is made up of two main components the Instruction Set Architecture (ISA) and the RTL model for the CPU.  In this class, we will have two software projects that will help in your understanding of the ISA and RTL model for the CPU.  The projects can be done in any software language that you chose to use.

The first project is the creation of an assembler.  The assembler will be use for you to write assembly language programs that will be executed on the CPU you will design in project #2.  The CPU we will be using is based on the DLX design.

Haven’t Found The Relevant Content? Hire a Subject Expert to Help You With
Computer architecture
Post Your Own Question And Get A Custom Answer
Hire Writer

What is an assembler?

All computer software goes through a set of applications to create an executable file that can be used by the end user.  The first program a programmer will used is a high level language program (C, C++, etc.).  The programmer writes in a very high level abstract environment writing code such as:

            For(x=0; x< 10; x++)

                        A[x] = x;

The high level language allows the programmer to write his program without knowing how the ISA and hardware architecture functions.  The language hides all the hardware from the programmer.  At some point, the source code needs to be transfer to a language that takes into account the ISA and hardware architecture.  The complier is the next step in the development process.

The complier will take in high-level source code and translate the program into assembly language.  Assembly language is the ISA for a computer.  Assembly is the instructions that the computer can perform.  The compiler will do the following:

            C language:  c = a + b;

            Assembly:      load r1, a

                                    Load r2,b

                                    Add r3,r1,r2

                                    Store r3,c

The last part of the development process is taking the assembly code created by the complier and transferring into machine code that the computer will execute.  A computer is not able to run written language such as ADD r1,r2,r3.  The computer runs a program by reading data stored in memory.  The memory does not the store the command ADD r1,r2,r3 but store machine code.  Machine code is the binary representation of an assembly language instruction.

The DLX Machine code

All the information for the DLX machine code and assembly instructions can be found in the handouts given in class. Each of the DLX instruction is 32-bits in length.  Each part of the instruction is assigned a set of bits in the instruction.  DLX break down the instructions into three different types R,I, and J.

R-type instruction

An example of the R-type instruction is ADD rd, rs1, rs2

The instruction is 32-bits in length:

Bits 31-26 is the opcode. The opcode tell the CPU what instruction it is doing

Bits 25-21 is the rs1

Bits 20-16 is the rs2

Bits 15-11 is the rd

Bits 10-0 is the funct.  Funct tells what type of ALU operation is being conducted.

I-type instruction

Ex ADDI rs1,rs2,immm

Bits 31-26 is the opcode

Bits 25-21 is rs1

Bits 20-16 is rs2

Bits 15-0 is immediate.  The immediate value is the constant value to use in the instruction

J-type instruction

Ex J address

Bits 31-26 is the opcode

Bits 25-0 is the address to jump to

What is my assignment?

Getting Started (Items you have to review or learn to do for the project)

In order to get started on creating your assembler you must be able to have the program understand basic syntax of a text file containing a program.  In this first part of the program you will deal with the basic functions of string processing and reading files.  The following is a list of items to complete to help you do the project.

1) You will need to be able to read in arguments pass from the command line.

Ex: project1.exe inputfile.txt outputfile1.txt

2) You will need to be able to parse a string.

Ex: You will need to use the strtok() function in the string.h file.

3) You will need to convert all letters to lowercase letters.

4) You will need to compare a string to a list of know words.

(add, load, store, r0, r1, r2)

5) You will need to have a number in text 123 be converted to a number (integer) in the C program.

6) You will also need to be able to read and write files.

Project #1

Your assignment is to make a simple assembler for the DLX processor.  We will simplify the assembler by only using the core instructions, we will not do the floating point instructions.  The registers will be named as r0, r1, r2, … r29, r30, r31.  We will also not allow any advance naming for saving constant or memory locations the assembly source code we write will hard code any constant and memory location to read and write to.  The only advance item we will do is use a label for branching and jumping in code.

Items to turn in: a report that tells how you created your program, source code, test files and a flow chart.

Tips

It is common to run an assembler in a two pass structure.  The first pass goes through the source files and finds all the labels and addresses for each instruction.  You can start your program by assuming the first line of code is at memory location 0.  You will make a table of label and address.  On the second pass you will then convert the assembly instruction into machine code and fill in any labels using your table.

Calculate the price of your order

Select your paper details and see how much our professional writing services will cost.

We`ll send you the first draft for approval by at
Price: $36
  • Freebies
  • Format
  • Formatting (MLA, APA, Chicago, custom, etc.)
  • Title page & bibliography
  • 24/7 customer support
  • Amendments to your paper when they are needed
  • Chat with your writer
  • 275 word/double-spaced page
  • 12 point Arial/Times New Roman
  • Double, single, and custom spacing
  • We care about originality

    Our custom human-written papers from top essay writers are always free from plagiarism.

  • We protect your privacy

    Your data and payment info stay secured every time you get our help from an essay writer.

  • You control your money

    Your money is safe with us. If your plans change, you can get it sent back to your card.

How it works

  1. 1
    You give us the details
    Complete a brief order form to tell us what kind of paper you need.
  2. 2
    We find you a top writer
    One of the best experts in your discipline starts working on your essay.
  3. 3
    You get the paper done
    Enjoy writing that meets your demands and high academic standards!

Samples from our advanced writers

Check out some essay pieces from our best essay writers before your place an order. They will help you better understand what our service can do for you.

Get your own paper from top experts

Order now

Perks of our essay writing service

We offer more than just hand-crafted papers customized for you. Here are more of our greatest perks.

  • Swift delivery
    Our writing service can deliver your short and urgent papers in just 4 hours!
  • Professional touch
    We find you a pro writer who knows all the ins and outs of your subject.
  • Easy order placing/tracking
    Create a new order and check on its progress at any time in your dashboard.
  • Help with any kind of paper
    Need a PhD thesis, research project, or a two-page essay? For you, we can do it all.
  • Experts in 80+ subjects
    Our pro writers can help you with anything, from nursing to business studies.
  • Calculations and code
    We also do math, write code, and solve problems in 30+ STEM disciplines.

Frequently asked questions

Get instant answers to the questions that students ask most often.

See full FAQ
  • What if I’m dissatisfied with the paper I get?

    The average quality score at our professional custom essay writing service is 8.5 out of 10. The high satisfaction rate is set by our Quality Control Department, which checks all papers before submission. The final check includes:
    • Compliance with initial order details.
    • Plagiarism.
    • Proper referencing.
    If for some reason we happen to leave a mistake unnoticed, you are invited to request unlimited revisions of your custom-written paper. For more information, check our Revision Policy. We will do our best to make your experience with Familiar Essays enjoyable.
  • I need an essay on the same day. Is it something you can do?

    Sure. Our writing company offers a fast service with an 8-hour deadline for orders up to master’s level. Make sure to specify the deadline in the order form and our writers will write a paper within the indicated timeslot. Just proceed to submit your requirements here Once you order a custom-written essay, our managers will assign your order to the well-suited writer, who has the best skills and experience for preparing your specific assignment. You can also request one of these extra features:
    • Choose the Writer’s Samples option – study 3 randomly-provided pages from orders that have been written by the assigned writer.
    • Request a specific writer – choose an academic writer from the dropdown list in the order’s form (optional for returning customers).
    You can be sure that your custom writing order will be accomplished by one of our 400+ professional academic writers. They all pass a series of tests to prove their writing prowess and hold the reputation of being the most professional in the industry. Want to make sure writer’s skills match your needs? Get more details on how to choose the appropriate author.
  • How can I be sure your writing service is not a scam?

    We understand that a shade of mistrust has covered the paper writing industry, and we want to convince you of our loyalty. Apart from high-quality writing services, we offer:
    • The chances of students to boost writing skills in a quick and effective way.
    • The opportunity to manage studies and free time in an enjoyable manner.
    • The possibilities to improve overall academic performance.
    Our custom writing company has been working for more than 12 years and always puts quality and clients’ needs first. Our operations are legally documented, we are easily accessible online and offline,
  • Is it legal to use your professional writing service?

    Yes. Custom writing help is not prohibited by any university or college. It’s a 100% legal way of getting professional assistance with paper writing. Hiring writers from an essay writing company is in many ways similar to consulting a tutor – we help you solve the writing issues at hand.
  • How does your service work?

    Our custom writing service is a reliable solution on your academic journey that will always help you if your deadline is too tight. You fill in the order form with your basic requirements for a paper: your academic level, paper type and format, the number of pages and sources, discipline, and deadline. Then, you describe the specific details of the paper you need: add the topic, write or paste the instructions, and attach files to be used, if you have them. After that, an online customer support representative chooses the best writer that specializes in your discipline and assigns him or her to complete the paper according to your requirements. When the paper is ready, we check it for plagiarism and send it to you. If you want to change something, you can request a free revision.
See full FAQ

Take your studies to the next level with our experienced specialists

Live ChatWhatsApp