loader image
Skip to main content
If you continue browsing this website, you agree to our policies:
x

Topic outline

  • Unit 2: Instructions: Hardware Language

    In order to understand computer architecture, you need to understand the components that comprise a computer and their interconnections. Sets of instructions, called programs, describe the computations that computers carry out. The instructions are strings of binary digits. When symbols are used for the binary strings, the instructions are called assembly language instructions. Components interpret the instructions and send signals to other components that cause the instruction to be carried out.

    In this unit, you will build on your knowledge of programming from CS102: Introduction to Computer Science II to learn how to program with an assembly language. You will use the instructions of a real processor, MIPS, to understand the basics of hardware language. We will also discuss the different classes of instructions typically found in computers and compare the MIPS instructions to those found in other popular processors made by Intel and ARM.

    Completing this unit should take you approximately 9 hours.

    • Upon successful completion of this unit, you will be able to:

      • draw the block diagram for the interface between hardware and software, and show how software instructs hardware to accomplish a simple program statement;
      • convert an integer into its binary and other representations;
      • convert a decimal number into its floating point representation;
      • explain how programs written in high-level programming languages, such as C or Java, can be translated into the language of the hardware; and show the process for a simple C program statement; and
      • write a simple MIPS assembly language program.
    • 2.1: Computer Hardware Operations

      • Read this article to see how a program is edited, compiled (or assembled), linked, and executed in the computer.

      • Read this article, which discusses how a MIPS assembly language statement is assembled into machine code. Carefully study the example in the article.

      • Read this article about how a computer actually executes the machine code produced by the compiler (assembler). Registers are simply small memory units that are usually 8, 16, 32, or more bits long. The program counter and instruction register are used in the machine cycle.

    • 2.2: Number Representation in Computers

      • Read this introduction to number systems.

      • Read this article on how numbers can be represented in 1's and 0's that the computer can understand. Study the way numbers can be converted into other representations, like binary, 2's complement, and so on. Also be sure to watch the videos, including the one on floating point representation. Study the examples of binary addition to make sure you understand how it works.

      • Read this article on the representation of real numbers. Read up to the section labeled "Addition and subtraction."

      • Study this article if you need more practice at understanding number systems.

      • This article demonstrates one method for converting from decimal to binary. This conversion is often used as a first step in converting from decimal to any other representation.

      • This article illustrates a second method for converting from decimal to binary. Use whichever method you prefer.

      • This page contains an interactive decimal to binary conversion when there are fractions involved. Click on the 0's to change them into 1's. You can also see the 2's complement representation for negative numbers.

    • 2.3: Instruction Representation

      • Read this article for an introduction to the three different instruction formats for the MIPS processor: the R-Format, the I-Format, and the J-Format instructions. MIPS is an acronym that stands for Microprocessor Instructions without Interlocked Pipeline Stages. MIPS is a RISC (Reduced Instruction Set Computer) introduced by MIPS technologies. Also, ISA, if you encounter it, stands for Instruction Set Architecture.

    • 2.4: Logical and Arithmetic Instructions

      • Read this article to learn about arithmetic and logical instructions for the MIPS processor.

    • 2.5: Control Instructions

      • Read this article to learn about the control flow instructions for the MIPS processor, including the basic ones: jump and branch instructions.

    • 2.6: Instructions for Memory Operations

      • Read this article to learn about memory instructions for the MIPS processor.

    • 2.7: Different Modes for Addressing Memory

      • Read this article to study the various formats for addressing memory.

      • MIPS assembly is an assembly language, which is a mnemonic or meaningful code for the machine language format in computer programming. Read this section to get a sense of how the addresses to memory are coded in a MIPS microprocessor.

    • 2.8: Case Study: Intel and ARM Instructions

      • Read this article, which gives two examples of instructions set architectures (ISAs). Look over how the different microprocessors address memory. Take note of similarities and differences of format, instructions and type of instructions, and addressing modes between these two as well as between these and the MIPS instructions of the previous sections.

    • Unit 2 Assessment

      • Take this assessment to see how well you understood this unit.

        • This assessment does not count towards your grade. It is just for practice!
        • You will see the correct answers when you submit your answers. Use this to help you study for the final exam!
        • You can take this assessment as many times as you want, whenever you want.