Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.

Slides:



Advertisements
Similar presentations
ADDER, HALF ADDER & FULL ADDER
Advertisements

Cs 1110 Ch 4-1 Combinational Logic. ° Introduction Logic circuits for digital systems may be: °2°2 combinational sequential OR A combinational circuit.
Combinational Circuits. Analysis Diagram Designing Combinational Circuits In general we have to do following steps: 1. Problem description 2. Input/output.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 7 Arithmetic Logic Unit February 19,
Addition (2). Outline Full Adder 3-Bit Adder 2’s Complement Subtraction.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
+ CS 325: CS Hardware and Software Organization and Architecture Combinational Circuits 1.
ADDERS Half Adders Recall that the basic rules of binary addition are as indicated below in Table 2-9. A circuit known as the half-adder carries out these.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
Basic Arithmetic (adding and subtracting)
Quiz What are the results of the following 4-bit bitwise logical operations? NOT OR NOR AND
IKI b-Arithmetic Logic Unit (ALU) Bobby Nazief Semester-I The materials on these slides are adopted from: CS231’s Lecture Notes at UIUC,
Lecture 18: Hardware for Arithmetic Today’s topic –Intro to Boolean functions (Continued) –Designing an ALU 1.
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
Universal college of engineering & technology. .By Harsh Patel)
CPS3340 Computer Architecture Fall Semester, 2013
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
CHAPTER 2 Digital Combinational Logic/Arithmetic Circuits
CO5023 Introduction to Digital Circuits. What do we know so far? How to represent numbers (integers and floating point) in binary How to convert between.
Number Representation (Part 2) Computer Architecture (Fall 2006)
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Simple ALU  Half adder  Full adder  Constructing 4 bits adder  ALU does several operations  General ALU structure  Timing diagram of adder  Overflow.
How does a Computer Add ? Logic Gates within chips: AND Gate A B Output OR Gate A B Output A B A B
Explain Half Adder and Full Adder with Truth Table.
Logic Gates Learning Objectives Learn that there is a one-to-one relationship between logic gates and Boolean expressions Learn how logic gates are combined.
1 Arithmetic Building Blocks Today: Signed ArithmeticFirst Hour: Signed Arithmetic –Section 5.1 of Katz’s Textbook –In-class Activity #1 Second Hour: Adder.
Addition and Subtraction
Combinational Circuits
Digital Arithmetic Wen-Hung Liao, Ph.D..
Computer Architecture & Operations I
Digital Systems Section 8 Multiplexers. Digital Systems Section 8 Multiplexers.
Combinational Circuits
University of Gujrat Department of Computer Science
XOR, XNOR, and Binary Adders
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
ECE/CS 552: Arithmetic and Logic
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
5. Combinational circuits
CSE Winter 2001 – Arithmetic Unit - 1
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
XOR, XNOR, & Binary Adders
Arithmetic Circuits (Part I) Randy H
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah –
EEL 3705 / 3705L Digital Logic Design
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Boolean Algebra.
ECE 301 – Digital Electronics
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah –
Number Systems and Circuits for Addition
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
Adders and Subtractors
Digital Logic.
COMS 361 Computer Organization
Multiple function unit design
XOR, XNOR, and Binary Adders
Combinational Circuits
XOR Function Logic Symbol  Description  Truth Table 
XOR, XNOR, and Binary Adders
MIPS ALU.
MIPS ALU.
Presentation transcript:

Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail

All materials is licensed under a Creative Commons “Share Alike” license. http://creativecommons.org/licenses/by-sa/3.0/ Attribution condition: You must indicate that derivative work "Is derived from Xeno Kovah's ‘Intro x86-64’ class, available at http://OpenSecurityTraining.info/IntroX86-64.html" Attribution condition: You must indicate that derivative work "Is derived from Xeno Kovah's 'Intro x86-64’ class, available at http://OpenSecurityTraining.info/IntroX86-64.html”

Digression – Why Two’s Compliment? Alternative methods of representing negative numbers (signed magnitude, or just ones compliment), as well as their problems presented on page 166-167 of the book. Note to self: show on board quick The benefit of two’s compliment is due to having only one representation of zero, and being able to reuse the same hardware for addition/subtraction Dave Keppler suggested expanding on this 46

Why Two’s Compliment? 2 Carry 1 1 5d + 6d 1b + 1b 11d 10b Table taken from http://thalia.spec.gmu.edu/~pparis/classes/notes_101/node110.html 47

Why Two’s Compliment? 3 A half adder circuit suffices for one bit addition XOR AND Picture taken from http://thalia.spec.gmu.edu/~pparis/classes/notes_101/node110.html 48

Why Two’s Compliment? 4 Full Adder You can’t just chain the one bit half adders together to get multi-bit adders. To see why, see the truth table at the link. Picture taken from http://thalia.spec.gmu.edu/~pparis/classes/notes_101/node111.html 49

(continue to make n bit adder) Why Two’s Compliment? 5 Note: we start with a half adder because a full adder would need a carry input at the start. However, if we wanted to use this for subtraction we could use a full adder to start. More on this on next slide. 2 bit adder 4 bit adder (continue to make n bit adder) Pictures taken from http://thalia.spec.gmu.edu/~pparis/classes/notes_101/node112.html http://thalia.spec.gmu.edu/~pparis/classes/notes_101/node113.html 50

Why Two’s Compliment? 6 So you have these physical adder circuits in the Arithmetic Logic Unit (ALU), and you can feed both add and subtract to the same circuit. But for this to work, you need to start with a full adder, and then run one the one subtract operand bits through not gates, and then set carry to one on the first full adder. Keppler’s example of x-y == x+(-y) Cause it was right there in my email and I’m lazy ;)   00001010   00001010 (10d) ==  00001010 (10d) + 00000101  -00000101 (5d)     +11111011 (-5d) ----------  ---------          ---------   00001111   00000101         1 00000101 51