Chapter 4.1 From Code To Hardware - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Chapter 4.1 From Code To Hardware

Description:

We start with code. From that code we get a 32-bit equivalent ... The possible inputs are a, b, and b. Causes set on. Less operation. From Code To Hardware ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 14
Provided by: jb20
Category:
Tags: chapter | code | hardware

less

Transcript and Presenter's Notes

Title: Chapter 4.1 From Code To Hardware


1
Clark UniversityComputer Science DepartmentCSCI
140 Computer OrganizationFrom Code To Hardware
Professor Jerry Breecher 2004
2
The Plan
  • We start with code.
  • From that code we get a 32-bit equivalent binary
    representation.
  • The binary maps what the hardware looks like.
  • The hardware reads each of those fields.
  • The hardware performs an operation.

3
We Start With Code

  • This is code that mimics the following C
    program.
  • main( )
  • printf( "Hello World\n" )

  • .text
  • .globl main
  • main
  • la a0, hello
  • ori v0, 0, 4 li v0, 4
  • add t0, t1, t2
  • syscall
  • jr ra
  • .data
  • hello

4
From that code we get a 32-bit Equivalent Binary
Representation.
  • 0x00400020 0x3c021001 lui 2, 4097 12
    la a0, hello
  • 0x00400024 0x34440000 ori 4, 2, 0
  • 0x00400028 0x34020004 ori 2, 0, 4 14
    ori v0, 0, 4
  • 0x0040002c 0x012a4020 add 8, 9, 10 14
    add t0,t1,t2
  • 0x00400030 0x0000000c syscall 15
    syscall
  • 0x00400034 0x03e00008 jr 31 16
    jr ra

0 1 2 a 4 0 2 0
0000 0001 0010 1010 0100 0000 0010 0000
0 9 10 8
0 32
000000 01001 01010 01000 00000 100000
5
What the hardware looks like.
  • Multiplexors

Selector
Selector
Input bits
Outputs
0
0
Input
Output
31
31
The 5 selector wires can choose one of the 32
inputs voltages and send it to the output.
The 5 selector wires choose which of the 32
outputs will get the input voltage.
6
What the hardware looks like.
This multiplexor is equivalent to 32 of those on
the previous page
  • Multiplexors

Bit 0
Bit 31
Selector
Bit 0
Bit 31
Input words

0


Word 0
Output
Word 31
31
End View
End View
Side View
Now, each of the 32 inputs has 32 bits. There
are 32 x 32 bits in and 1 x 32 bits out.
Each of these input words COULD be a register!
7
What the hardware looks like.
  • ALU
  • On this and the next few pages, we look at
    increasingly complicated forms of ALU.
  • These pictures are taken from Figs 4.14, 4.17,
    4.18, 4.19 in the text.

A 1-bit ALU that performs AND, OR, and ADDITION.
8
What the hardware looks like.
  • ALU Continued

Causes set on Less operation.
A 1-bit ALU that performs AND, OR, and
ADDITION. The possible inputs are a, b, and b
9
What the hardware looks like.
  • ALU Continued

A 32-bit ALU that performs AND, OR, and
ADDITION. This is made up of 32 of the sub-pieces
weve just examined.
10
What the hardware looks like.
  • ALU Continued

11
What the hardware looks like.
  • Registers

Op
Select
5 wires
R0
6 wires
MUX To ALU
R8
A
B
MUX To ALU
ALU
c
ovf
Out
MUX From ALU
R31
12
What the hardware looks like.
Op
  • Registers

R0
MUX To ALU
R8
A
B
MUX To ALU
ALU
Out
MUX From ALU
R31
13
The hardware reads each of those fields.
0 9 10
8 0 32
000000 01001 01010 01000 00000 100000
  • Registers

R0
MUX To ALU
R8
A
B
MUX To ALU
ALU
Out
MUX From ALU
R31
Write a Comment
User Comments (0)
About PowerShow.com