User Tools

Site Tools


opus:spring2012:dgirard3:asmpart2

asm Keywords

Fetch-execute cycle

Definition

The sequence of actions that a central processing unit performs to execute each machine code instruction in a program. It goes through all the components of the computer such as the CPU, then the processor, instruction register, etc.

Demonstration

This picture accurately shows the route of this cycle.

Binary and Hexadecimal Number Representation

Definition

Binary representation is taking a decimal number, a number such as 6 and changing it into a binary number which would be 110. Now in binary it only uses 1 and 0, a computer can only read these values so thats why it is necessary for this. But if we were to get more intricate, we would get into hexadecimal. Hexadecimal is 0 to the letter f. In a computer we start getting bigger with our numbers so it compacts the binary down so we dont have huge lines of code.

Demonstration

This is a table of showing how to do simple conversions of smaller decimal numbers. it shows how binary and hex represents its numbers.

Boolean Arithmetic Operations (Addition, Subtraction, Multiplication, Division)

Definition

Boolean Arithmetic is the logic behind our logic gates such as AND, NOR, OR, NOT and so on. The operations behind it is what makes the magic happen. Addition and multiplication is all you really need because subtraction and division are just variances of the others. But like with addition you have 1 plus 1 equals 1 or 1 plus 0 equals 1.

Demonstration

These are the logic gates that would implement these type of operations.

Registers (General Purpose/Integer, Floating Pointer, Accumulator, Data)

Definition

General purpose registers can store both data and addresses, i.e., they are combined Data/Address registers. They can be known as GPR's. Floating point registers store floating points in many computers today. Accumulator which intermediate arithmetic and logic results are stored. Without a register like an accumulator, it would be necessary to write the result of each calculation (addition, multiplication, shift, etc.) to main memory. Data register can hold numeric values such as int, floating and even char.

Processor & Memory Organization

Definition

The number of registers in a processor unit may vary from just one processor register to as many as 64 registers or more. One part you will have is the accumulator AC or 'A' register. It is the main operand register of the ALU. Then you will have the data register (DR) acts as a buffer between the CPU and main memory. It is used as an input operand register with the accumulator. Then the instruction register (IR) holds the opcode of the current instruction. Next is the address register (AR) holds the address of the memory in which the operand resides. Lastly, the program counter (PC) holds the address of the next instruction to be fetched for execution. There can always be additional registers within the processor but these are the main ones you will find. There are actually more then one way to organize memory but it will general be connected to cache or RAM to store most of the data that is ran through the processor.

von Neumann vs. Harvard architecture

Definition

The most obvious characteristic of the Harvard Architecture is that it separates signals and storage for code and data memory. Typically, code (or program) memory is read-only and data memory is read-write. Therefore, it is impossible for program contents to be modified by the program itself. In the Von neumann architecture all signals and storage was shared, so it was easily changeable in a read-write memory.

Demonstration

Here is a picture example.

Logic Operations (AND, OR, XOR)

Definition

These logic operations are the simple operations of the logic gates. AND is where bot statement 1 AND statement 2 must be true for it to pass. OR is saying that statement 1 OR statement 2 need to be true in order for it to pass. XOR is saying that one of the 2 statements must be true and the other must be false, if anything else its not true.

Demonstration

AND

  1 // nick sano
  2 #include "and.h"
  3
  4 bool AND::getX()
  5 {
  6     bool tmp = false;
  7
  8     if((A == true) && (B == true))
  9     {
 10         tmp = true;
 11     }
 12
 13      return tmp;
 14 }

OR

  1 #include "or.h"
  2
  3 bool OR :: getX()
  4 {
  5     bool tmp = false;
  6     if((A == true) || (B == true))
  7     {
  8         tmp = true;
  9     }
 10     return(tmp);
 11 }

XOR

  1 
  2 #include "xor.h"
  3
  4 XOR::XOR()
  5 {
  6     myorgate = new OR();
  7     mynotgate = new NOT();
  8     myandgate = new AND();
  9 }
 10
 11 bool XOR::getX()
 12 {
 13     bool tmp = true;
 14
 15     myandgate -> setA(A);
 16     mynotgate -> setA(B);
 17     tmp = mynotgate -> getX();
 18     myandgate -> setB(tmp);
 19     myorgate -> setA(myandgate -> getX());
 20
 21     myandgate -> setB(B);
 22     mynotgate -> setA(A);
 23     tmp = mynotgate -> getX();
 24     myandgate -> setA(tmp);
 25     myorgate -> setB(myandgate -> getX());
 26     tmp = myorgate -> getX();
 27
 28     return(tmp);
 29 }

Negated Logic Operations (NOT, NAND, NOR, XNOR)

Definition

These are the negative operators of the logic table. NOT just takes what you currently have and negates it. NAND AND NOR take what they normally do (AND=1 and 2 both must be true, OR= 1 or 2 can be true) and just takes the opposite of what they do. So if it was true when AND was run, now that result will be untrue. and XNOR will run to see if both statements are true or both are false.

Demonstration

NOT

 1 #include "not.h"
  2
  3 bool NOT::getX()
  4 {
  5     bool tmp;
  6     tmp = ! A;
  7     return(tmp);
  8 }

NAND

 1 #include "nand.h"
  2
  3 NAND::NAND()
  4 {
  5     myandgate = new AND();
  6     mynotgate = new NOT();
  7 }
  8
  9 bool NAND::getX()
 10 {
 11     bool tmp = true;
 12
 13     myandgate -> setA(A);
 14     myandgate -> setB(B);
 15
 16     tmp = myandgate -> getX();
 17
 18     mynotgate -> setA(tmp);
 19
 20     tmp = mynotgate -> getX();
 21
 22     return(tmp);
 23 }
 24

NOR

  1 #include "nor.h"
  2
  3 NOR::NOR()
  4 {
  5     myorgate = new OR();
  6     mynotgate = new NOT();
  7 }
  8
  9 bool NOR::getX()
 10 {
 11     bool tmp = false;
 12
 13     myorgate -> setA(A);
 14     myorgate -> setB(B);
 15
 16     tmp = myorgate -> getX();
 17
 18     mynotgate -> setA(tmp);
 19
 20     tmp = mynotgate -> getX();
 21     return(tmp);
 22 }

XNOR

  1 #include "xnor.h"
  2
  3 XNOR::XNOR()
  4 {
  5     myxorgate = new XOR();
  6     mynotgate = new NOT();
  7 }
  8
  9 bool XNOR::getX()
 10 {
 11     bool tmp;
 12
 13     myxorgate -> setA(A);
 14     myxorgate -> setB(B);
 15     tmp = myxorgate -> getX();
 16     mynotgate -> setA(tmp);
 17     tmp = mynotgate -> getX();
 18
 19     return(tmp);
 20 }

asm Objective

asm Objective

An understanding of the concepts of assembly

Definition

Do you know what assembly is? How does it work? etc.

Method

I will discuss this and just state what i know of this language.

Measurement

Assembly language is the lowest level language that we have. It is used for microprocessors, processors, single instruction mechanical computers and a computer. Assembly Language uses 'mnemonic codes' or 'symbols'. Instead of remembering the exact memory locations where data and instructions are stored, symbolic memory addresses are used for data. In the language there is assemble that converts the assembly into object code. There is a single assembler and a multi one. both do similar things, just obviously one runs more then one.

MOV AL, 1h        ; Load AL with immediate value 1
MOV CL, 2h        ; Load CL with immediate value 2
MOV DL, 3h        ; Load DL with immediate value 3

this is an example of what assembly looks like. You have to move data line by line to get it where you want it. There are no shortcuts. Assembly is the basis of pretty much everything and without it, we would not have gotten as far as we did, today.

Analysis

Reflect upon your results of the measurement to ascertain your achievement of the particular course objective. I think i did pretty well. We didnt touch assembly much but i think i have gained a little knowledge towards it and i believe i have conveyed the concept quite nicely.

opus/spring2012/dgirard3/asmpart2.txt · Last modified: 2012/05/10 03:54 by dgirard3