Computer Architecture CS 320 Lecture 4 PDF

Document Details

BrandNewPanPipes

Uploaded by BrandNewPanPipes

Thebes Higher Institute of Computer and Management Sciences

Dr. Khaled El Helow

Tags

computer architecture mips format two's complement digital logic

Summary

This lecture covers MIPS format and two's complement numbers in computer architecture, focusing on practical applications. It explains how to negate binary numbers using the two's complement method.

Full Transcript

Thebes Academy Thebes Higher Institute of Computer & Management Sciences Computer Architecture CS 320 Dr. Khaled El Helow Kh...

Thebes Academy Thebes Higher Institute of Computer & Management Sciences Computer Architecture CS 320 Dr. Khaled El Helow [email protected] Lecture 4 MIPS FORMAT Let’s examine two useful shortcuts when working with two’s complement numbers. The first shortcut is a quick way to negate a two’s complement binary number. Simply invert every 0 to 1 and every 1 to 0, then add one to the result. This shortcut is based on the observation that the sum of a number and its inverted representation must be 111... 111 , two which represents -1. Since 𝑥 + 𝑥ഥ = −1 therefore 𝑥 + 𝑥ഥ + 1 = 0 or 𝑥ഥ + 1 = −𝑥. (We use the notation 𝑥ഥ to mean invert every bit in x from 0 to 1 and vice versa.) MIPS Format R-Format I-Format J-Format Arithmetic Immediate arithmetic Jump Shift LW/SW Branch

Use Quizgecko on...
Browser
Browser