Autor Tema: aYUDA PLS aLU DE CUATRO ENTRADAS  (Leído 3459 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado shadowspider29

  • PIC10
  • *
  • Mensajes: 2
aYUDA PLS aLU DE CUATRO ENTRADAS
« en: 05 de Noviembre de 2004, 23:35:00 »
HOLA SI ALGUIN PRODRIA AYUDARME YA QUE ESTOY EN ESTO DE LE VHDL Y EL PROFE DEJO ESTO TENEMOS QUE HACER UNA ALU DE 4 ENTRADAS
ESTO FUE LOQ UE NOS DIO PERO NI UNA SOLA PALABRA  NOS EXPLICO SOBRE EL CIRCUITO, LO QUE HE INVESTIGADO SOBRE LAS ALU ES QUE SE PROGRAMAN PARA HACER TODO CASI TIPO DE OPERACIONES.
ESTO FUE LO QUE EL NOS DIO PERO NO EXPLICO NADA RollEyesIdeaRebotado

F      | Operacion       |    Ia   | Ib   | R   |
000   | A+B+Ci                       |    0   |      0   |     S   |
001   |A-B-1+Ci                        |    0   |      1   |     S   |
010   |B-A-1-Ci                       |    1   |      0   |     S   |
011   |A  XOR B                       |    0   |      0   |     P   |
100   |A  AND  B                       |    0   |      0   |     G   |
101   |A´AND B                       |    1   |      0   |     G   |
110   |A OR B           |    1   |      1   |     G´   |
111   |A XNOR B       |    1   |      0   |     P   |



4 XOR VECTORIALES
1 AND VECTORIAL
1 NOT VECTORIAL
1 CLA
MUX 4-1 VECTORIAL
1 GENERADOR DE BANDERAS
1 DECODIFICADOR DE SEÑALES INTERNAS

PODRIA ALGUIEN AYUDARME??? ME URGE POR FAVOR.
SE LOS AGRADECERIA INFINITAMENTE GiñoGiño GRACIAS

Desconectado Elena2000

  • PIC24F
  • *****
  • Mensajes: 722
RE: aYUDA PLS aLU DE CUATRO ENTRADAS
« Respuesta #1 en: 22 de Noviembre de 2004, 09:36:00 »
Hola!!

Siento el retraso en contestar, estoy muy liada....

A ver, revisando mis papelotes aparece un modelo de ALU que debí hacer hace un tiempo. Te lo pongo por aquí por si te puede ayudar y darte pistas de cómo hacer la tuya. Ya verás que no es complicado, anda, anímate, que lo que te puso el profesor está "escondido", pero no es muy oscuro...

Codigo:

;DEFINICIÓN DE LA ENTIDAD
library ieee;
use ieee.std_logic_1164.all;
use work.alu_types.all;
entity alu is
  port ( a1, a2 : in std_ulogic_vector;
         resultado : out std_ulogic_vector;
         funcion : in alu_func;
         cero, negativa, overflow : out std_ulogic );
end entity alu;

;PAQUETE CON LOS COMPONENTES
library ieee;  
use ieee.std_logic_1164.all;
package alu_types is

  subtype alu_func is std_ulogic_vector(3 downto 0);

  constant alu_add : alu_func := "0000";
  constant alu_addu : alu_func := "0001";
  constant alu_sub : alu_func := "0010";
  constant alu_subu : alu_func := "0011";

end package alu_types;

; Y POR ULTIMO EL COMPORTAMIENTO
architecture behavior of alu is
begin

  alu_op: process (a1, a2, func) is

    constant Tpd : delay_length := 10 ns;
    variable bv_s1 : bit_vector(s1"range);
    variable bv_s2 : bit_vector(s2"range);
    variable temp_result : bit_vector(result"range);
    constant cero_result : bit_vector(result"range) := (others => "0");
    variable temp_overflow : boolean;

    type boolean_to_X01_table is array (boolean) of X01;
    constant boolean_to_X01 : boolean_to_X01_table
      := ( false => "0", true => "1" );

  begin
    bv_s1 := To_bitvector(s1);
    bv_s2 := To_bitvector(s2);
    case funcion is
      when alu_add =>
        bv_add(bv_s1, bv_s2, temp_result, temp_overflow);
      when alu_addu =>
        bv_addu(bv_s1, bv_s2, temp_result, temp_overflow);
      when alu_sub =>
        bv_sub(bv_s1, bv_s2, temp_result, temp_overflow);
      when alu_subu =>
        bv_subu(bv_s1, bv_s2, temp_result, temp_overflow);
      when others =>
        report "alu: funcionamient erroneo" severity error;
        temp_result := (others => "0");  temp_overflow := false;
    end case;
    resultado <= To_X01(temp_result) after Tpd;
    cero <= boolean_to_X01(temp_result = zero_result) after Tpd;
    negativa <= To_X01(temp_result(temp_result"left)) after Tpd;
    overflow <= boolean_to_X01(temp_overflow) after Tpd;
  end process alu_op;

end architecture behavior;



Desconectado shadowspider29

  • PIC10
  • *
  • Mensajes: 2
RE: aYUDA PLS aLU DE CUATRO ENTRADAS
« Respuesta #2 en: 31 de Diciembre de 2004, 10:39:00 »
hola primero que nada muchas gracias por la ayuda con el codigo y siculpa que me aya tardado en agredacer es que andaba algo ocupadillo tambien. pero si fue de mucha utilidad al fin pude sacarla.
me ayudo mucho GiñoMuchas risasSonrisa


 

anything