Building Your Own Machine The Universal Machine (UM) Introduction Noah Mendelsohn Tufts University Web:

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

CH10 Instruction Sets: Characteristics and Functions
Introduction to Machine/Assembler Language Noah Mendelsohn Tufts University Web:
Copyright 2014 – Noah Mendelsohn Assemblers, Macros and The UM Macro Assembler (UMASM) Noah Mendelsohn Tufts University
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
Chapter 2.
1: Background1 System Programming ( 系統程式 ) Main goal: r What is a system software? m Compiler m Assembler m Loader and Linker m Debugger… r To design and.
Fall 2001CS 4471 CS 447: Fall 2001 Chapter 1: Computer Abstraction and Technology (Introduction to the course)
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
What is an instruction set?
Computer Architecture and Organization
MIPS assembly. Computer What’s in a computer? Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
Welcome to COMP 40! Noah Mendelsohn Tufts University Web: COMP 40: Machine Structure.
COE Computer Organization & Assembly Language Talal Alkharobi.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
CS1Q Computer Systems Lecture 3 Simon Gay. Lecture 3CS1Q Computer Systems - Simon Gay2 Where we are Global computing: the Internet Networks and distributed.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
1 A Simple but Realistic Assembly Language for a Course in Computer Organization Eric Larson Moon Ok Kim Seattle University October 25, 2008.
Computer Architecture and Organization Introduction.
EKT 422 Computer Architecture
Chapter 1 Introduction. Architecture & Organization 1 Architecture is those attributes visible to the programmer —Instruction set, number of bits used.
CS 111 – Sept. 15 Chapter 2 – Manipulating data by performing instructions “What is going on in the CPU?” Commitment: –Please read through section 2.3.
Chapter 2 Data Manipulation. © 2005 Pearson Addison-Wesley. All rights reserved 2-2 Chapter 2: Data Manipulation 2.1 Computer Architecture 2.2 Machine.
Computer Architecture EKT 422
MICROOCESSORS AND MICROCONTROLLER:
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO CS 219 Computer Organization.
What is a program? A sequence of steps
Representing Negative Numbers Noah Mendelsohn Tufts University Web: COMP 40: Machine.
MIPS assembly. Computer  What’s in a computer?  Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
The Universal Machine (UM) Implementing the UM Noah Mendelsohn Tufts University Web:
1 TM 1 Embedded Systems Lab./Honam University ARM Microprocessor Programming Model.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
CPS4200 System Programming Spring 1 Systems Programming Chapter 1 Background I.
© 2015 Pearson Education Limited 2015 Quiz in last 15 minutes Midterm 1 is next Sunday Assignment 1 due today at 4pm Assignment 2 will be up today; due.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
System Programming and administration
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Microprocessor and Assembly Language
Overview Introduction General Register Organization Stack Organization
Prof. Sirer CS 316 Cornell University
MIPS Assembly.
Instructions - Type and Format
ECEG-3202 Computer Architecture and Organization
CSC Classes Required for TCC CS Degree
MIPS assembly.
Morgan Kaufmann Publishers The Processor
Chapter 2: Data Manipulation
ECEG-3202 Computer Architecture and Organization
ECEG-3202 Computer Architecture and Organization
ECEG-3202 Computer Architecture and Organization
Chapter 1 Introduction.
Prof. Sirer CS 316 Cornell University
Chapter 2: Data Manipulation
COMS 361 Computer Organization
Course Outline for Computer Architecture
Chapter 6 Programming the basic computer
Review In last lecture, done with unsigned and signed number representation. Introduced how to represent real numbers in float format.
CS501 Advanced Computer Architecture
Chapter 2: Data Manipulation
William Stallings Computer Organization and Architecture 7th Edition
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

Building Your Own Machine The Universal Machine (UM) Introduction Noah Mendelsohn Tufts University Web: COMP 40: Machine Structure and Assembly Language Programming (Fall 2014)

© 2010 Noah Mendelsohn COMP 40 Roadmap 2 Ramp up your Programming Skills Big programs that teach you abstraction, pointers, locality, machine representations of data Building a Language Processor on your Emulator Emulating your own hardware in software Intel Assembler Programming The Bomb! Building Useful Applications in your Language

© 2010 Noah Mendelsohn Introducing the Universal Machine

© 2010 Noah Mendelsohn Why work with the UM?  AMD64 is complicated – UM has 14 instructions  Easy to implement (HW or SW)  Learn more about assemblers and linkers  Learn to write assembler code  You will write an emulator for this machine – emulation is a wonderful and important technique!  The term UM traces to the work of Alan Turing 4 Detailed specification for the UM will come with your next assignment

© 2010 Noah Mendelsohn UM Highlights  8 32 bit registers (no floating point)  14 RISC-style (simple) instructions  Load/store architecture: all manipulation done in registers  Segmented memory –Executing code lives in segment 0 –Programs can create and map new zero-filled segments –Any segment can be cloned to become the new code segment (0)  Simple byte-oriented I/O  Does not have explicit: –Jump/branch –Subtract –Shift 5

© 2010 Noah Mendelsohn 14 UM Instructions  Arithmetic and data  Add, multiply, divide (not subtract!)  Load value  Conditional move  Logical  Bitwise nand (~and)  Memory management  Map/unmap segment  Segmented load/store  Load program  I/O  Input (one byte), Output (one byte)  Misc  Halt 6

© 2010 Noah Mendelsohn 14 UM Instructions  Arithmetic and data  Add, multiply, diviicde (not subtract!)  Load value  Conditional move  Logical  Bitwise nand (~and)  Memory management  Map/unmap segment  Segmented load/store  Load program  I/O  Input (one byte), Output (one byte)  Misc  Halt 7 Add: $r[A] := ($r[B] + $r[C]) mod 2 32 Documented in the form of assignment statements (register transfer langauge – RTL)

© 2010 Noah Mendelsohn Instruction Format 14 UM Instructions  Arithmetic and data  Add, multiply, diviicde (not subtract!)  Load value  Conditional move  Logical  Bitwise nand (~and)  Memory management  Map/unmap segment  Segmented load/store  Load program  I/O  Input (one byte), Output (one byte)  Misc  Halt 8 RCOPRBR1 Add: $r[A] := ($r[B] + $r[C]) mod 2 32

© 2010 Noah Mendelsohn 14 UM Instructions  Arithmetic and data  Add, multiply, diviicde (not subtract!)  Load value  Conditional move  Logical  Bitwise nand (~and)  Memory management  Map/unmap segment  Segmented load/store  Load program  I/O  Input (one byte), Output (one byte)  Misc  Halt 9 RC3RBR Instruction Format 4 bits to select one of 14 operations Add: $r[A] := ($r[B] + $r[C]) mod 2 32

© 2010 Noah Mendelsohn 14 UM Instructions  Arithmetic and data  Add, multiply, diviicde (not subtract!)  Load value  Conditional move  Logical  Bitwise nand (~and)  Memory management  Map/unmap segment  Segmented load/store  Load program  I/O  Input (one byte), Output (one byte)  Misc  Halt 10 RCOPRBR Instruction Format 3 bits to select one of 8 registers Add: $r[A] := ($r[B] + $r[C]) mod 2 32

© 2010 Noah Mendelsohn What’s different from AMD64?  Very few instructions – can we do real work?  Pointers to words not bytes  Segmented memory model  AMD/Intel has I/O, but we did not study it  No floating point 11

© 2010 Noah Mendelsohn Next time we will discuss in more detail  Memory models and the segmented memory of the UM  I/O  How programs start and execute  Building complex instructions from simple ones 12

© 2010 Noah Mendelsohn Computability and Turing-Completeness

© 2010 Noah Mendelsohn Emulators

© 2010 Noah Mendelsohn Emulators  Hardware or software that implements another machine architecture  Great way to learn about machines: –The emulator you write will do in software the same thing machines do in hw  Terrific tool for –Testing code before hardware is ready –Performance analysis (e.g. our testcachesim ) –Evaluating processor/memory design before committing to build chip –Moving systems to a new architecture (e.g. Apple move from PowerPC to Intel) 15

© 2010 Noah Mendelsohn Question?  How would you implement an emulator for the UM? 16