User Tools

Site Tools


opus:spring2012:bkenne11:asmpart3

asm Keywords

von neumann vs. harvard architecture

Definition

A battle between computer architectures.

The harvard architecture has completely separate storage and signal pathways for instructions and data. This architecture stored all data within the CPU, and had no access to the instruction storage as data. All programs were loaded by a person. This means that the cpu can both read an instruction and perfom a data memory access at the same time, without a cache. The harvard architecture also has distinct data address spaces: instruction address zero is not the same as data address zero.

In contrast, the von neumann architecture can either be reading an instruction or reading/writing data to/from the memory. They cant both happen at the same time because the instructions and data use the same system bus.

The harvard architecture would be faster because instruction fetches and data access do not contend for a single memory pathway.

Binary and Hex number representation

Definition

The representation and conversions of/between hexadecimal, binary and decimal numbers.

Each digit in a binary number is called a bit, which form a byte when 8 bits are wrapped together. These bytes can take on the form of any combination of a “1” and a “0”, such as 10110010 or 00001001. This number system is called base 2, because is only has two different characters in its representation.

Below is a layout of the positioning of a binary byte.

Bit Placementbit 8bit 7bit 6bit 5bit 4bit 3bit 2bit 1
Value128643216 8 4 2 1

Therefore, with a binary number like 10011101, we get:

binary number10011101
ad up the place values of the ones12800168401

decimal equivalent is: 157

In hexadecimal, four bits is represented by a single digit. Since 4 bits gives 16 possible combinations, 0-9 are used along with A-F to represent the characters, meaning that hexadecimal must be base 16.

Below shows a relationship between hex, binary, and decimal.

DecimalHexadecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
10A1010
11B1011
12C1100
13D1101
14E1110
15F1111

For example, the number D93A is two bytes of data: 1101 1001 0011 1010. In decimal, 1101=13 + 1001=9 + 0011=3+ 1010=10 = 35.

Processor & Memory Organization

Definition

The major parts of a CPU are:

  • Registers
  • Flags
  • ALU
  • Buses
  • Control unit

The structure of these CPU's usually follows this scheme:

The Control unit acts as sort of a interfact to the outside via pins then buses. Then on the inside it communicates with the registers and the ALU, which can communicate with each other, or something like that.

Memory is organized into a two main different areas: On the CPU: Registers/RAM. Off the CPU: RAM, Harddrive, CD, Flash memory.

Control and Data Flow

Definition

Control flow literaly refers to controlling the flow of the program, or in what order the instructions of a program are executed in. A controlflow statement would have a condition that, based on the outcome of the condition, tells the program to do down one of two paths. In assembly, this control flow is based on a program counter. For most CPU's, the only control flow instruction available is a branch instruction.

if(day == monday)
{
    go get groceries;
}
else
{
    write down what groceries you need to get on monday;
}

Data Instructions

(Data Movement, Address Movement, Data Conversion, Bit Manipulation)

Definition

Data Movement

Data movement between registers and memory. This could be moving any peice of data from memory to a register in order to manipulate it, or loading an address from memory into registers so that it can be loaded.

Data Conversion

Converting between data encoding schemes such as Ascii, unicode and morse code. All of which are just a character pattern to represent a series of bits. This can be something as simple as a software upgrade from version 1.0 to 1.2.

Bit Manipulation

Bit mainpulation deals with manipulating a sting of binary bits. This includes functions like:

  • Increment
  • Decrement
  • Shift left or right
  • Roll left or right
  • AND, NOT, OR, XOR

Programming languages allow programmers to deal with high level representations of bit patterns and editing bit patterns via functions as described above like AND and left shift.

I/0

Definition

I/0 or Input/Output is something we do an uncountable amount of times a day. We are constantly sending and receiving message and signals that tell us how to interact and react to an enviroment. Similarly, it is how a computer communicates with another computer or a human. In other words it is how a computer sends/receives messages/signal/data.

Examples of input devices are mice and keyboards, which the computer receives input in the form of a mouse button press or a key press on the keyboard. An output device would be a printer, monitor or speakers, in which the computer outputs data in the form of sound or words for the user to read. An example of an input/output device is a disk drive or a flash drive. The computer can both read and write data to these devices. For a lower level implementation, the processor inputs/outputs device drivers that run these devices. The processor also provides memory-mapped I/O that is used the low level programming of these drivers.

Data Representation 1

Big Endian, Little Endian, Size, Integer, Floating Point, ASCII

Definition

Endian refers to end, and specifies which end of the number trail is the most significant bit. The twp types on endian are big and little, only differing in the position of the most significant big.

Big Endian

Big endian is where the most significant bit is on the left hand side and move to the right in order of decreasing significance. Therefore in 1010, the one all the way to the left would be the most significant and would represent 8, while the 0 all the way on the right would be the least significant and would represent 1.

Little Endian

Little endian is the reverse of big endian, and implements the common form of a “carry”. In little endian the most significant bit is on the right, while the least significant bit is on the left. Therefore in 1010, the one all the way to the left is now the least significant and represents 1, while the 0 on the right is the most significant and represents the 8.

Integer

An integer is a four byte data type that can be represented as a signed or unsigned range. A signed range allows for negative numbers, while an unsigned range allows for only non-negative numbers 0 or greater, within the size. This size can vary within computer architectures, but is most commonly four bytes.

INTEGER low high
Signed -2,147,483,648 2,147,483,647
Unsigned 0 4,294,967,295

There is four ways to represent a negative binary number, and the most common is two's compliment. For a deffinition of two's compliment look at the key word below labeled “data representation 2”.

Floating Point

Floating point descibes a way to represent real-numbers in a way that can show a wide range of values. These numbers are generally truncated to a fixed number of significant digits and then scaled by an exponent. Floating point means that the decimal point can float around the number, relative to the significant digits, and scaled to an exponent. The base for scaling is usually 2, 10, or 16.

Ascii

Ascii is a character encoding scheme used for information interchange. Ascii, based on the English language, represents text in computers, communications, and anything else that uses text. Ascii text, being an encomding scheme used for information interchange, represents series of bits. for example, the ascii character F is 01010111.

Data Representation 2

Sign Representation, One's Complement, Two's Complement

Signed Number Representation

signed number representation deals with encoding for negative numbers in the binary number system. In regular mathematics a negative number is prefixed by a - sign, showing that it is a negative number, but in binary there is no - sign. This is where sign representation methods come in to play.

One's Compliment

The one's compliment form of a negative binary number is a bitwise NOT applied to its positive couterpart. This system has two ways to represent zero: 00000000 which is a +0, and 11111111 which is a -0. As an example, the one's compliment of 00110100 (52) is 11001011 (-52). A byte thus ranges from -127 to +127 with a +-0.

binary valueone's complimentunsigned binary
00000000 0 0
00000001 1 1
00000010 2 2
00001010 10 10
01111101 125 125
01111110 126 126
01111111 127 127
10000000 -127 128
10000001 -126 129
10000010 -125 130
11110101 -10 245
11111101 -2 253
11111110 -1 254
11111111 -0 255
Two's Compliment

In two's compliment there is only one 0, 00000000. Negating a number is done by inverting all bits and then adding 1 to the resulting number. Therefore 01001110 (78) negated is 10110010 (-78) or 10110001 + 1.

binary valuetwo's complimentunsigned binary
00000000 0 0
00000001 1 1
00000010 2 2
00001010 10 10
01111101 125 125
01111110 126 126
01111111 127 127
10000000 -128 128
10000001 -127 129
10000010 -126 130
11110101 -10 245
11111110 -2 254
11111111 -1 255

asm Objective

asm Objective

Familiarity with the role of the C library.

Definition

Understanding the power of the vast resources of the C library. Familiarity with the types of functions in the many libraries, and familiarity with the man page function in order to understand what libraries are needed for what functions.

Method

Testing and improving my knowledge of what libraries are needed for the functions I have used and have knowledge of.

Measurement

I ran through some old programs and made sure I knew what libraries they were found in and I also looked up a listing of a lot of functions in the C library to try and broaden my understanding of what functions are available.

Analysis

Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.

  • How did you do? There isn't a real way to qauge this, but I did improve my understanding of the functions available through the C library.
  • Is there room for improvement? always is
  • Could the measurement process be enhanced to be more effective? always can be
  • Do you think this enhancement would be efficient to employ? always would be
  • Could the course objective be altered to be more applicable? How would you alter it? Give a more detailed explanation.
opus/spring2012/bkenne11/asmpart3.txt · Last modified: 2012/05/01 21:16 by bkenne11