Computer Systems

studied byStudied by 1 Person
0.0(0)
Get a hint
hint

Why are numbers in the computer represented in 2's complement?

1/105

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

Studying Progress

New cards
105
Still learning
0
Almost done
0
Mastered
0
105 Terms
New cards

Why are numbers in the computer represented in 2's complement?

The number of bits available for representing a number is limited; it is not clear how to represent a negative number

New cards
New cards

A byte is

8 bits

New cards
New cards

An ASCII length

7 bits and sign bit is always 0

New cards
New cards

When does overflow happen?

If you add two positives and the leftmost bit turns out negative; If you add two negatives and the leftmost bit turns out positive

New cards
New cards

How do you know there is a carry?

Extra leftmost bit

New cards
New cards

How do you know there is borrow?

In a substraction A - B, B is greater than A (need to take 2's complement and do addition A + 2's of B)

New cards
New cards

What is a BCD?

Binary coded decimal; each decimal digit has a representation of two numbers per byte (that look just like the decimal number) and zeros to fill in the missing bytes

New cards
New cards

What format is used for floating point numbers?

IEEE Single Point Precision Format

New cards
New cards

What are the steps for IEEE?

Convert floating point number to binary (for the decimal, multiply the value of the decimal times 2 and only count the number before the decimal point, then multiply the result by 2 and so on until you have an equal amount of results as number of decimals); decide sign bit; move the decimal point to the right of the leftmost bit; do "excess-127" (127 + binary exponent); put it together = sign bit + exponent + mantissa

New cards
New cards

What is the binary conversion of 128?

1000 0000

New cards
New cards

OR

New cards
New cards

AND

New cards
New cards

The hexadecimal system represents numbers using about ____ as many digits as the binary system.

1/4

New cards
New cards

What is CRLF? (ASCII)

Newline

New cards
New cards

What are the three basic types of instruction operands?

Constants, CPU register designations, and references to memory locations.

New cards
New cards

Why do we not use signed magnitude to represent signed numbers in a computer?

We do not use signed magnitude to represent signed numbers in a computer because adding or subtracting two values in sign magnitude does not always lead to the correct result. Another reason is because the left most bit is used to indicate if a value is positive or negative while the magnitude bits indicate a value. This can make interpreting the value in sign magnitude extremely confusing and lead to incorrect interpretations.

New cards
New cards

What is the difference between a "carry in" and a "carry out"?

"Carry in" means there was a carry into the left most bit (sign bit) while "carry out" means there was a carry out of the left most bit. This occurs when adding two signed values. (In other words. If two values are added such as A + 7 the sum in decimal would be 17. Thus, 17 - 16 = 1. As a result, you would put down 1 to indicate the difference between the sum and 16 and carry one over to the next numerical place value to indicate a carry of 16.)

New cards
New cards

What is the difference between the term, "two's complement representation", and "calculating the two's complement of a number"?

The two's complement representation is the signed fixed length representation of a value. Calculating the two's complement of a number is taking a number that is assumed to be in an unsigned form and converting to a signed form within a fixed length.

New cards
New cards

Justify your agreement or disagreement to the following: "Signed magnitude cannot be used as a means to represent signed numbers in a computer."

Sign magnitude cannot be used to represent signed numbers in a computer because if you add two values in sign magnitude you can get an incorrect answer. Also, it uses the left most bit (sign bit) as a 1 to indicate a negative value whilst all other bits in the magnitude are supposed to indicate an integer representation. This can be incredibly hard to distinguish thus signed magnitude should not be used as a means to represent signed numbers in a computer.

New cards
New cards

Six (cap, its five) basic components of a computer

CPU, Memory (RAM), input, output, and AUX memory

New cards
New cards

What are the parts of a CPU?

Control unit, arithmetic logic unit, registers (storage locations)

New cards
New cards

Is memory linear or a grid?

Linear

New cards
New cards

What terminates the information stored in RAM?

RAM will lose its memory after the computer is powered off.

New cards
New cards

What are some examples of input devices?

Keyboard, mouse, microphone

New cards
New cards

What are examples of output devices?

Monitor, speakers, printer

New cards
New cards

What are some examples of aux storage?

Harddrive, flashdrive

New cards
New cards

What does "byte-addresable" mean?

Each byte in memory has its own address

New cards
New cards

Flat Memory Model

An approach to assigning memory addresses in which memory locations are described by single unsigned integers corresponding to linear positions.

New cards
New cards

Segmented Memory Model

An approach to assigning memory addresses in which primary storage is divided into equal sized segments called pages, identified by sequential nonnegative integers; each memory address depends on its segment number (chunks of memory)

New cards
New cards

Paging

A memory management scheme where a computer stores and retrieves data from secondary storage for use in main memory.

New cards
New cards

What is the instruction pointer?

eip; holds address of the next instruction to be performed.

New cards
New cards

What are the parts of "add sum, 5"? (Mneumonic + operand)

Add = mnemonic; sum, 5 = operand; both = instruction

New cards
New cards

Where are the instructions held in the instruction execution cycle?

RAM

New cards
New cards

Parts of Instruction Execution Cycle

Fetch (find out what is in eip and through address bus go into ram to get the corresponding bytes) Decode (In the control unit) Fetch operands Execute (Into the a/l unit) Store output

New cards
New cards

What are the 2 buses involved in the Instruction Execution Cycle?

Address and data

New cards
New cards

How are instructions stored in memory?

One byte has the mnemonic (opcode), the address of dest is stored, and then is source address (or value if it is immediate); information is stored in binary.

New cards
New cards

The bottleneck for the Instruction Execution Cycle

The system bus; everything we do goes through the system bus (CPU to MEMORY and back); 2^32 binary values at a time.

New cards
New cards

What does A/L Unit stand for?

Arithmetic/Logic Unit; gets information for memory or register receives data and perform calculation

New cards
New cards

What is the job of the CPU?

To direct traffic across the system bus.

New cards
New cards

What is the job of the CPU's control unit?

To interpret an opcode and directs the execution.

New cards
New cards

What is the control bus?

It tells us who is using the system bus at a point; monitors transmission of memory.

New cards
New cards

How many GB of data can be in the RAM?

4GB (2^32 = Address bus is 32-bit)

New cards
New cards

What is the unsigned range of values that can be addressed?

0 -> 4,294,967,295 (0 -> 2^32 - 1)

New cards
New cards

What are the 4 General Purpose Registers

eax, ebx, ecx, edx (32-bit)

New cards
New cards

What are the four Index Registers?

ESI (Source Index Registers), EDI (Destination Index Registers), ESP (Stack Pointer), EBP (Base Pointer); (32-bit) for both you can only get to the low orderword

New cards
New cards

What is the Instruction Pointer?

EIP

New cards
New cards

Pre-Fetching Instructions

CPU fetches instructions before a prior instruction is executed.

New cards
New cards

When does a stall in the pipeline occur?

When two instructions attempt to use the same register.

New cards
New cards

What bit is CF

0

New cards
New cards

What bit is PF

2

New cards
New cards

What bit is ZF

6

New cards
New cards

What bit is SF

7

New cards
New cards

What bit is DF

10

New cards
New cards

What bit is OF

11

New cards
New cards

What is the maximum capacity IN HEX on a 32-bit system bus?

00 00 00 00 -> FF FF FF FF

New cards
New cards

The EAX register is sometimes known as the _________. Why?

Accumulator; because it is the destination of arithmetic results.

New cards
New cards

What are the three parts of the accumulator?

AX (0-15 bit), AH (8-15), AL (0-7)

New cards
New cards

What criterion must be satisfied for a value to be stored in Little ENDian?

It must be a numerical value (scaled value), it must be stored in memory, and it must be multibyte.

New cards
New cards

What is an instruction?

Statement that is translated by the assembler into machine code

New cards
New cards

What is a directive?

Indicates where to take action but does not result in execution of machine code

New cards
New cards

What does a macro do?

Calls a chunk of code to be exevuted

New cards
New cards

What character starts a comment in assembly code?

;

New cards
New cards

Is .586 an instruction or a directive?

Directive

New cards
New cards

Is mov eax, val an instruction or a macro?

Instruction

New cards
New cards

Is input prompt1, string, 40 an instruction or a macro?

Macro

New cards
New cards

Do all directives start with a '.'?

No

New cards
New cards

Is DWORD a macro or a directive?

Directive (allocates memory)

New cards
New cards

What are the main parts of a typical instruction? (4)

Name, mnemonic, operands, comment

New cards
New cards

If we have EAX = 0x 00 00 10 04 and the instruction mov sum, eax, how is EAX value stored in sum?

Little ENDian; 04 10 00 00

New cards
New cards

In Little ENDian, the destination stores the least significant byte (rightmost) from the source in the ________ memory address.

Smallest

New cards
New cards

How many bytes of memory does a word allocate?

2

New cards
New cards

How many bytes of memory does a dword allocate?

4

New cards
New cards

How many bytes of memory does a qword allocate?

8

New cards
New cards

If in the data segment you declare: char1 BYTE 'q', and in the code segment it says mov ax, char1, what would be the error?

Size mismatch (or size ambiguity; ax is a 16-bit register while char1 is an 8-bit register)

New cards
New cards

What are the three types of instruction operands?

Constants (or immediate; add eax, 5), CPU Register (add eax, 5), memory location (add sum, eax)

New cards
New cards

What are the three general addressing modes?

Immediate, register, memory

New cards
New cards

What are the two types of memory addressing modes?

Direct and register indirect

New cards
New cards

What addressing mode is add sum, eax using?

Direct, register

New cards
New cards

What addressing mode is add [ebx], eax using?

Register indirect, register

New cards
New cards

What addressing mode is add ax, 6 using?

Immediate

New cards
New cards

What addressing mode is add 6, ax using?

N/A (An immediate value can not be a destination)

New cards
New cards

What addressing mode is add [ebx], 20 using?

Size mismatch (neither [ebx] or 20 indicate size, [ebx] because it is a pointer while 20 because it is an immediate value)

New cards
New cards

What addressing mode is add BYTE PTR [ebx], 20?

Register indirect

New cards
New cards

What could "io.h" be compared to in c++?

Header file

New cards