程序代写代做代考 computer architecture assembly MSCP 52011

MSCP 52011
Introduction to Computer Systems
Computer Architecture
Computer Architecture
Harvard Machine
• Physically separate data storage and instruction storage
• Physically separate signal pathways for instructions and data
Von Neuman Machine
• One memory storage for both instructions and data
• Disadvantage: can read one instruction OR read/ write to memory; can’t do both at the same time

Advantage: access to more than one memory system at a time; can read next instruction and perform ALU calculation at the same time

Advantage: instruction code can be treated as data

The Hack Architecture
• 16-bit Von Neumann platform (technically called a Harvard Architecture)
• Instruction memory and data memory are physically separate
• I/O: 512 by 256 black and white screen, standard keyboard
• Designed to execute programs written in Hack
• Can be built from the chip set built in projects 1-3
The Hack Architecture
• CPU
• Instruction memory (ROM)
• Memory (RAM) • Data memory • Screen
• Keyboard
• Computer (the glue that holds everything together)

Fetch-Execute Cycle
Executing an instruction involves doing one or more of the following tasks:
•Have the ALU compute some function f(registers, memory) •Write the ALU output to register(s) and/or memory
•As a side effect of executing these tasks, figure out which instruction to fetch and execute next
What we are doing… (what are we doing?)
@17 0000000000010001 M=A 1110110000001000 D=M+1 1111110111010000
0000000000010001
1110110000001000
1111110111010000



Executes the instruction according the to the Hack language specification The A and D registers are inside the CPU
• •
Ifreset=1thenPCis set to0 Build for project 5
Central Processing Unit (CPU)

the value of the A register is placed in addressM, and writeM is set to 1
If the instruction specifies writing to RAM, then the M value is placed in outM,
CPU Implementation C-Instruction

Central Processing Unit (CPU)
CHIP CPU {
IN inM[16], instruction[16], reset;
OUT outM[16], writeM, addressM[15], pc[15];
PARTS:
// Implementation missing
}

Instruction Memory
• Pre-loaded with a machine language program
• Always emits a 16-bit number 

out = ROM32K[address]
• That number is the current instruction 
 (in machine language )
• Built-in chip
Data Memory
• Given address, in, load

out = RAM16K[address]

if load then RAM16K[address] = in
• Built in project 3

Screen
Functions like a 16-bit 8K RAM:

out = Screen[address]

if load then RAM16K[address] = in
• •


Each bit in memory corresponds to one pixel on screen
Side effect: continuously refreshes a 256 by 512 black-and-white screen
Built-in chip
Keyboard
16-bit register
Input: 16-bit value coming from a physical keyboard
Stores and outputs the scan code of the pressed key, or 0 if no key is pressed
• •
• • •
Read keyboard by probing the contents of the Keyboard register Built-in chip

Memory Map
• •
• • •
Access to any address from 0 to 16,383 results in accessing the RAM
Access to any address from 16,384 to 24,575 results in accessing the Screen
Access to address 24,576 results in accessing the keyboard register Access to any address > 24,576 is invalid
Build this chip in project 5
Computer Chip Interface

Assignments

• •

Project 4:Assembly language programs
 Mult and Fill

Upload by 6am next Friday
Read chapter 5 before doing project 5
Project 5: Build chips
 Memory, CPU, Computer
 Upload by 6am next Friday
Read chapter 6 before class next week

Week 4:Assessment
All material weeks 1-3
• combinational chips
• sequential chips
• circuit design, K-maps, logisim, hdl, hardware
• simulator
binary arithmetic, negative number systems
 Online Assessment
• • •
assessment will be posted at 5:30 Thursday files to be completed and uploaded by 6:30 lecture at 7:00