Lab #2 Hints. CMPE12cCyrus Bazeghi 2 Want to produce ASCII table Needs to be in a form like: DecHexOctChar 4830600.

Slides:



Advertisements
Similar presentations
Lecture 5: MIPS Instruction Set
Advertisements

NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
Number Bases Informatics INFO I101 February 9, 2004 John C. Paolillo, Instructor.
DATA REPRESENTATION CONVERSION.
Floating Point Numbers. CMPE12cCyrus Bazeghi 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or 2 64.
1 Representing Numbers Using Bases Numbers in base 10 are called decimal numbers, they are composed of 10 numerals ( ספרות ) = 9* * *10.
Review of CMPE12C Fall CMPE12cCyrus Bazeghi 2 Practice Final Exam Simply print out all the homework solutions and the Midterm solutions and do problems.
Agenda Shortcuts converting among numbering systems –Binary to Hex / Hex to Binary –Binary to Octal / Octal to Binary Signed and unsigned binary numbers.
Bit Operations C is well suited to system programming because it contains operators that can manipulate data at the bit level –Example: The Internet requires.
A bit can have one of two values: 0 or 1. The C language provides four operators that can be used to perform bitwise operations on the individual bits.
Number Systems and Codes In PLC
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
They are the same as registers since they store binary numbers. Called shifting registers since they shift (left or right) the binary number stored in.
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic.
Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information Technology Islamic.
Number Systems.
1 Computer Fundamental ITD1382 Coursework : 100% 1. Tests 2. Quizzes (Short) 3. Assignments Module Value : 3.0.
CMPE 325 Computer Architecture II Cem Ergün Eastern Mediterranean University Integer Representation and the ALU.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Supplemental Chapter Number Bases
Conversion of Number System Conversion Among Bases The possibilities: Hexadecimal DecimalOctal Binary
Number System. Number Systems Important Number systems – Decimal – Binary – Hexadecimal.
Number Base Conversions
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Chapter 2 Data Representation.
Octal to Decimal Hexadecimal DecimalOctal Binary.
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
ACOE2511 Assembly Language for the 80X86/Pentium Intel Microprocessors Lecturer: Dr. Konstantinos Tatas.
Chapter 2 Bits, Data Types, and Operations. 2-2 Hexadecimal Notation It is often convenient to write binary (base-2) numbers as hexadecimal (base-16)
CS 101 – Aug. 31 Interpreting binary  decimal √ Decimal  binary Shorthand ways of expressing binary –Octal –“Hex” Negative numbers.
Lecture 1: 8/27/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Octal & Hexadecimal Number Systems
MECH1500 Chapter 3.
EET 4250 Instruction Representation & Formats Acknowledgements: Some slides and lecture notes for this course adapted from Prof. Mary Jane Penn.
Topic 14.1 Extended Hexadecimal  Decimal is base 10 and uses 10 digits (0,1,2,3,4,5,6,7,8,9).  Binary is base 2 and uses 2 digits (0,1).  Computers.
CSC 3210 Computer Organization and Programming
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
Cis303a_chapt03_exam1_answer.ppt CIS303A: System Architecture Exam 1: Chapter 3 Answer List the characters (digits) for the following bases. 1) Decimal:
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
Chapter 32 Binary Number System. Objectives After completing this chapter, you will be able to: –Describe the binary number system –Identify the place.
Chapter 5 NUMBER REPRESENTATION AND ARITHMETIC CIRCUITS.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
1 Digital Logic Design (41-135) Chapter 5 Number Representation & Arithmetic Circuits Younglok Kim Dept. of Electrical Engineering Sogang University Spring.
Lecturer: Santokh Singh
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Octal to Decimal Decimal Octal Binary Hexadecimal.
Computer Organisation
Unit 18: Computational Thinking
Programming in Machine Language
By: Jonathan O. Cabriana
Lecture 4: MIPS Instruction Set
Number Systems and Bitwise Operation
University of Gujrat Department of Computer Science
Data Storage Introduction to computer, 2nd semester, 2010/2011
Binary Quiz UIN: ____________________
King Fahd University of Petroleum and Minerals
Number Systems Base 2, 10, 16.
Computer Architecture & Operations I
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
There are 10 types of people of people in this world…
Lecture 9: Radix-64 Tutorial
Table 1.1 Powers of Two.
Binary Addition (1 of 2) Two 1-bit values A B A + B 1
CS334: Number Systems Lab 1.
Remember the 10 types of people of people in this world…
Presentation transcript:

Lab #2 Hints

CMPE12cCyrus Bazeghi 2 Want to produce ASCII table Needs to be in a form like: DecHexOctChar

CMPE12cCyrus Bazeghi 3 MAL and data types What does our MIPS architecture store into register $s1 for this instruction? li$s1, 4 $s “The 2SC representation of 4” 031

CMPE12cCyrus Bazeghi 4 How to convert binary to Hexadecimal and Octal Break up into groups of 4 (hex) and 3 (oct) How?

CMPE12cCyrus Bazeghi 5 How with MAL Need to get just the bits we want into the LSB. For example, if we have and want to print the hex out we need to print out the top 4 bits grouped, then the bottom 4 bits.

CMPE12cCyrus Bazeghi 6 New Instructions How to move bits around in a word? srl – Shift Right Logical Takes words and shifts to the right, adding 0’s at the top.

CMPE12cCyrus Bazeghi 7 Shift Right Logical Examples: # $s0 contains 0x0… srl$t0, $s0, 3 # $t0 now 0x0… srl$t0, $s0, 4 # $t0 now 0x0…

CMPE12cCyrus Bazeghi 8 Masking How about getting rid of bits not wanted? For example, if we have and I want to print it out in hex, how do I print just the bottom 4 bits?

CMPE12cCyrus Bazeghi 9 New Instruction How to “mask” out bits in a word and – bit wise “and” operator ABAND “Truth Table” Basically if and’ing to 0 result is zero, if and’ing to 1 result is other input value

CMPE12cCyrus Bazeghi 10 How to use “and” Format of the instruction and$t0, $s0, mask or register Ex:and$s0, $s0, 0x0F # this will leave only the bottom # 4 bits of $s0 untouched

CMPE12cCyrus Bazeghi 11 What is the gotcha with Hex? Decimal and Octal are easy to convert into a ASCII digits since only 0-9 or 0-7 How to handle hex?