Question

In: Electrical Engineering

Write the code to compare two 8-bit buses, a and b. The output signal is agrb...

Write the code to compare two 8-bit buses, a and b. The output signal is agrb for “a greater than b.”

Solutions

Expert Solution

-----------the VHDL code for your design is--------------

---------VHDL CODE-------------
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
entity compare_8bit is
     port(
         a : in STD_LOGIC_VECTOR(7 downto 0);
         b : in STD_LOGIC_VECTOR(7 downto 0);
       
         agrb : out STD_LOGIC
       
         );
end compare_8bit;

architecture Behavioural of compare_8bit is
begin

agrb<= '1' when (a>b) else
               '0';

end Behavioural;

////////the verilog module for your design is ////////////////

module compare_8_bit (a,b,agrb);///declare the inputs and output
input [7:0] a,b;
output agrb;    ///output signal Q (Q3Q2Q1Q0)



assign agrb=(a>b)?1:0;///?-is ternaery operator compares a,b
                        //ifa>b then agrb signal equal to 1 otherwise 0
endmodule

(If you satisfied rate the answer, If you have any query leave a comment, Thank you)


Related Solutions

What's the schematic of the 4-bit multiplier that has two 4-bit inputs and an 8-bit output...
What's the schematic of the 4-bit multiplier that has two 4-bit inputs and an 8-bit output with pure combinational logic? Can you draw the circuit?
Description of how buses are used within a microprocessor such as the 8-bit AVR used in...
Description of how buses are used within a microprocessor such as the 8-bit AVR used in the Arduino microcontroller A block diagram that shows the 8-bit AVR along with the data and address busses. Use a graphics package such as Fritzing or equivalent
I am trying to write the code for an 8 bit adder in VHDL so that...
I am trying to write the code for an 8 bit adder in VHDL so that I can program it onto my Elbert V2 Spartan 3A FPGA Development Board, but I keep getting errors. Any ideas what I am doing wrong? library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity adder8bit is Port ( a : in STD_LOGIC_VECTOR(7 downto 0); b : in STD_LOGIC_VECTOR(7 downto 0); cin : in STD_LOGIC; o : out STD_LOGIC_VECTOR(7 downto 0); cout : out STD_LOGIC); end adder8bit; architecture Behavioral...
Write a VHDL code to implement a Finite State Machine that with an 8 bit sequence...
Write a VHDL code to implement a Finite State Machine that with an 8 bit sequence input (can be any sequence, but lets say it is 11001000), determine how many states there are as well; so if the input sequence is correct it will show the number 1 in a 7 segment display, otherwise it will be 0 in the same 7 segment display. If the input sequence is incorrect, start from the beginning.
Question B Write an 8 bit adder module in System Verilog by appropriately connecting two 4...
Question B Write an 8 bit adder module in System Verilog by appropriately connecting two 4 bit adders (the System Verilog code of a 4 bit adder is available in the lecture notes). Instantiate your 8 bit adder module on DE2 board. Design a test circuit on DE2 board that allows us to test the 8 bit adder using the switches and the seven segment displays on DE2 board. The test circuit will need the module you designed for Part...
Write a VHDL code for a 4-bit comparator which takes two 4-bit input values and (0.5)...
Write a VHDL code for a 4-bit comparator which takes two 4-bit input values and (0.5) determines whether the numbers are equal. 2. 2. Write a structural VHDL code to implement the circuit of Fig. 2, using the components (0.5) developed in 1.3 and 2.1. 2. 3. Write a VHDL test bench for the above and verify by simulation. (0.5) 2. 4. Implement the design in an FPGA (Note: You may need a `clock manager' to reduce (1.0) the clock...
code an 8 bit LFSR random number generator in system verilog. Write a test bench, load...
code an 8 bit LFSR random number generator in system verilog. Write a test bench, load the seed 11111111, and generate the first 10 random numbers.
Write a verilog code for 8-bit signed multiplication using Booth algorithm and represent the RTL view...
Write a verilog code for 8-bit signed multiplication using Booth algorithm and represent the RTL view for code
Design an 8-bit adder. Show Verilog code and testbench.
Design an 8-bit adder. Show Verilog code and testbench.
if an 8-bit sar adc is used to digitize 8v full scale signal, what will be...
if an 8-bit sar adc is used to digitize 8v full scale signal, what will be the digital o/p for an analog i/p of 5.76 v
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT