CPSC 2500: Computer Organization

Ace your homework & exams now with Quizwiz!

Fraction to Floating Point

(I) Convert the decimal number into a binary number. (II) Express the floating point number in scientific notation. (III) Fill in the various fields of the floating point number appropriately. 1.Begin with the decimal fraction F 2. Multiply the fraction F by two; F = F*2 3. Whole number part "W" of the multiplication result in step 2 is the next binary digit to the right of the point 4. Update F by discarding the whole number part; F = F -W5. If F > 0, repeat steps 2, 3, 4

Decimal to Binary

(I) Divide the number by 2. (II) Get the integer quotient for the next iteration. (III) Get the remainder for the binary digit. (IV) Repeat the steps until the quotient is equal to 0.

Hexadecimal to Decimal

(I) Get the decimal equivalent of hex from the table. (II) Multiply every digit with 16 power of digit location. (zero based, 7DE: E location is 0, D location is 1 and the 7 location is 2) (III) Sum all the multipliers. Ex: 7DE is a hex number 7DE = (7 * 162) + (13 * 161) + (14 * 160) 7DE = (7 * 256) + (13 * 16) + (14 * 1) 7DE = 1792 + 208 + 14 7DE = 2014 (in decimal number)

Binary Arithmetic

0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 10

Decimal to Floating Point

1. Convert the decimal number into a binary number. 2. Express the floating point number in scientific notation. 3. Fill in the various fields of the floating point number appropriately.

Memory Addresses

2^10 = Kilobyte (KB) 2^20 = Megabyte (MB) 2^30 = Gigabyte (GB) 2^40 = Terabyte (TB) 2^50 = Petabyte (PB) 2^60 = Exabyte (EB) 2^70 = Zettabyte (ZB) 2^80 = Yottabyte (YB)

Full Adder

A full adder is a digital circuit that performs addition. • A full adder adds three one-bit binary numbers, two operands and a carry bit. • The adder outputs two numbers, a sum and a carry bit.

Half Adder

A half adder is a type of adder, an electronic circuit that performs the addition of numbers. • The half adder is able to add two single binary digits and provide the output plus a carry value. • It has two inputs, called A and B, and two outputs S (sum) and C (carry). • The common representation uses a XOR logic gate and an AND logic gate

Computer

A machine that can do work for people by carrying out instructions given to it. Consists of: • A processor to interpret and execute programs. • A memory to store both data and programs. • An input/output mechanism for transferring data to and from the outside world.

Boolean Algebra

A method for expressing mathematically a logic circuit

De Morgan's Law

A process for simplifying Boolean expressions • !AB = !A + !B • !A+B = !A!B *break the line, change the sign

Multi-Core Processor

A single chip with multiple processing units • Allows multiple programs to be executed at once • Software can take advantage of multiple processing units but it's harder to write. A single-threaded program can only run on one core at a time. • Faster than using separate chips each with their own processor

Tri-State Buffer

A useful device that allows us to control when current passes through the device Two inputs: • A data input x and a control input c. • The control input acts like a valve. When the control input is active, the output is the input.

Sum of Products Form

Boolean sum of terms • Each row in the truth table refers to a different minterm • Simply create a Boolean sum of the minterms that correspond to each row that has an output of 1

Arithmetic Overflow

An attempt to represent an integer that exceeds the maximum allowable value.

Binary to Decimal

Ex: Find the decimal value of 111001: 111001 = 1⋅2^5 + 1⋅2^4 + 1⋅2^3 + 0⋅2^2 + 0⋅2^1 + 1⋅2^0 = 5710

0

False

Program

List of ordered machine instructions

Assembly Instructions

Most (16-bit) instructions have up to three operands or fields that specify... • Where to get data that is used by the instruction (registers, memory, input, the instruction itself). • Where to put data that is produced by the instruction (registers, memory, output).

Boolean Operators

OR gate: X Y X+Y 0 0 0 0 1 1 0 1 1 1 1 1

Arithmetic Logic Unit (ALU)

Performs simple operations on data • All arithmetic operations (for example, addition and subtraction) and all logic operations (such as sorting and comparing numbers)

Control Unit

Responsible for interfacing with memory and decoding instructions.

Addi

The add immediate instruction (addi) has the following format: addi Rd Rs1 Imm6 R(Rd) <- R(Rs1) + Imm6

Shf

The shift instruction has a similar format: shf Rd Rs1 Imm6 • This instruction shifts the contents of Rs1and places the results in Rd. • The number of the bits and direction of the shift is determined by the immediate: • If Imm6is positive: shift the contents of Rs1 left by Imm6bits. • If Imm6is negative: shift the content of Rs1 logically right by abs(Imm6) bits.

LLI and LUI

Used in tandem to initialize registers • lli rd imm8 load lower immediate • lui rd imm8 load upper immediate lli must be executed before lui otherwise lli will overwrite lui

Decoder

Used to select a line based on a binary number (address). • Has n inputs, 2n outputs

1

True

Two's Complement Overflow

When the "carry in" and the "carry out" of the sign bit are different, overflow has occurred.

Add (ANNA)

add Rd Rs1 Rs2 R(Rd) <- R(Rs1) + R(Rs2)

bez and bgz

bez (1010): branch if equal to zero bgz (1011): branch if greater than zero Ex: bez rd imm8 bgz rd imm8 Range: -127 to 128 Used for if-else statements and loops

Memory Organization

https://www.youtube.com/watch?v=cNN_tTXABUA

Other operations (ANNA)

sub Rd Rs1 Rs2 R(Rd) <- R(Rs1) -R(Rs2) and Rd Rs1 Rs2 R(Rd) <- R(Rs1) & R(Rs2) or Rd Rs1 Rs2 R(Rd) <- R(Rs1) | R(Rs2) not Rd Rs1 R(Rd) <~R(Rs1)

Powers of 2

• 2^0 = 1; 2^1 = 2 • 2^2 = 4; 2^3 = 8 • 2^4 = 16; 2^5 = 32 • 2^6 = 64; 2^7 = 128 • 2^8 = 256; 2^9 = 512 • 2^10 = 1024; 2^11 = 2048 • 2^-1 = .50; 2^-2 = .25 • 2^-3 = .125; 2^-4 = .0625 • 2^-5 = .03125; 2^-6 = .015625

Von Neumann Model

• A central processing unit (CPU) • A main memory system • A control unit • Input equipment • Output equipment

Fixed Length Integers

• An unsigned (nonnegative) integer of n bits can represent values of 0 to 2^(n) - 1. Ex: 8 bits = -128 to 127 (unsigned) = 0 to 256 (signed) valid range = -126 to 127 (11111111 and 00000000 are reserved)

Byte

• Group of 8-bits • Abbreviated using a capital B

Assembly Language

• Human-readable form of machine language • Easy translation to machine language • Very machine dependent

Registers

• Memory located inside Central Processing Unit (CPU) • Used to hold results (such as computations from ALU) temporarily.

Multiplexer (MUX)

• Selects a single output from several inputs. • The particular input chosen for output is determined by the value of the multiplexer's control lines. • To be able to select among n inputs, log2n control lines are needed.

Word

• Sequential group of bytes • Refers to the size of an address or integer • The most common sizes are 32 bits (4 bytes) and 64 bits (8 bytes)

Machine Language

• Simply ones and zeros • Understood by the computer • Hard to understand by humans

Main Memory (aka Random Access Memory - RAM)

• Stores the instructions currently executing in CPU • Stores data used and/or generated by the program

Two's Complement

• Two's complement numbers arrange negative and positive numbers in an ordered number line. • The way in which a computer represents integers Negating (express negative value): 1. Start with the positive representation. 2. Flip the bits: 0-1, 1-0. (bitwise not) 3. Add 1. Range: -128 to 127 https://www.cs.cornell.edu/~tomf/notes/cps104/twoscomp.html


Related study sets

HCD 303: Global Healthcare Systems

View Set

VHL - En el Periódico: Pretérito y Imperfecto.

View Set

MAN 3025 Final Guide (6, 16, 17, 19, 20)

View Set