ALU%20and%20Shifters%20Lab%202 - PowerPoint PPT Presentation

About This Presentation
Title:

ALU%20and%20Shifters%20Lab%202

Description:

ALU and Shifters Lab 2 Mano and Kime Sections 7-6 7-8 ALU and Shifters ALUs Shifters Lab 2 ALU and Shifters ALUs Shifters Lab 2 4-Bit Basic Shifter ALU and ... – PowerPoint PPT presentation

Number of Views:145
Avg rating:3.0/5.0
Slides: 17
Provided by: Richard2041
Category:

less

Transcript and Presenter's Notes

Title: ALU%20and%20Shifters%20Lab%202


1
ALU and ShiftersLab 2
  • Mano and Kime
  • Sections 7-6 7-8

2
ALU and Shifters
  • ALUs
  • Shifters
  • Lab 2

3
n-Bit ALU
4
Arithmetic Circuit
5
(No Transcript)
6
(No Transcript)
7
(No Transcript)
8
(No Transcript)
9
(No Transcript)
10
ALU and Shifters
  • ALUs
  • Shifters
  • Lab 2

11
4-Bit Basic Shifter
S 00 No shift S 01 Right shift S 10
Left shift
12
4-Bit Barrel Shifter
13
ALU and Shifters
  • ALUs
  • Shifters
  • Lab 2

14
Lab 2 ALU1Shifting, Increment and Decrement
Instructions
15
alu1 entity
library IEEE use IEEE.std_logic_1164.all use
IEEE.std_logic_unsigned.all   entity alu1 is
generic(widthpositive) port ( a in
STD_LOGIC_VECTOR(width-1 downto 0) sel
in STD_LOGIC_VECTOR(2 downto 0) y out
STD_LOGIC_VECTOR(width-1 downto 0) ) end
alu1
16
architecture alu1_arch of alu1 is begin alu_1
process(a, sel) variable true, false
STD_LOGIC_VECTOR (width-1 downto 0) begin --
true is all ones false is all zeros for i
in 0 to width-1 loop true(i) '1'
false(i) '0' end loop case sel is
when "000" gt -- 1 y lt a 1
when "001" gt -- 1- y lt a -
1 when "010" gt --
invert y lt not a when "011"
gt -- 2 y lt a(width-2 downto 0) '0'
when "100" gt -- U2/ y lt '0'
a(width-1 downto 1)
when "101" gt -- 2/ y lt a(width-1)
a(width-1 downto 1) when "110"
gt -- TRUE y lt true
when others gt -- FALSE y
lt false end case end process
alu_1 end alu1_arch
Note forloop
Write a Comment
User Comments (0)
About PowerShow.com