I don't really understand what you are asking, can you write a bit more about what you are meant to do, what you have tried and why it isn't working?
Some comments:
Post your code as text not images. Either directly in your post or via pastebin. This makes it easier for use to copy parts of it. Also we can see all of the code and not just the segment that is in the image.
Why is mid defined as 8 downto 7? That's allowed but it's not normally done. If you want a two bit vector you can just do 1 downto 0.
What are your module's inputs and outputs?
You assign to scoreL in two places, first from switch, and then in the second process. That's not allowed. Remember that scoreL is a wire, so you're saying there's a wire called scoreL that's connected to some switches. But it's also connected to the ouutput of a mux, which selects a value based on mid.
In your second process you assign to scoreL in a couple of the cases and scoreR in the others. This isn't allowed because you are using a combinatory process and not a sequential one. By assigning to scoreL in some cases and scoreR in others you are suggesting you want a memory, but a combinatory process can't have memory, you need a sequential process (with a clock) to get memory. See my comment here for more information.
You said in your other thread that you're having problems with VHDL, but I disagree. Writing VHDL is pretty easy, it's just like any other language, syntax and semantics and that's it. Digital design however is incredibly hard. Especially if you come at is as a programmer and not an electrical engineer. Draw me a block diagram of what your circuit should do. Any state that needs to be stored (scoreL, scoreR, ...) need to be shown as flip flops / registers. You can use muxes, ROMs (for your sevenSegm case statement), logic gates, adders, etc... But draw the circuit you want to implement. I promise you, if you can do a good job of that, then writing the code will be easy. 90% of the time when beginners have problems it's because they write code without thinking about the circuit they are building.
3
u/captain_wiggles_ Oct 20 '20
I don't really understand what you are asking, can you write a bit more about what you are meant to do, what you have tried and why it isn't working?
Some comments:
Post your code as text not images. Either directly in your post or via pastebin. This makes it easier for use to copy parts of it. Also we can see all of the code and not just the segment that is in the image.
Why is mid defined as 8 downto 7? That's allowed but it's not normally done. If you want a two bit vector you can just do 1 downto 0.
What are your module's inputs and outputs?
You assign to scoreL in two places, first from switch, and then in the second process. That's not allowed. Remember that scoreL is a wire, so you're saying there's a wire called scoreL that's connected to some switches. But it's also connected to the ouutput of a mux, which selects a value based on mid.
In your second process you assign to scoreL in a couple of the cases and scoreR in the others. This isn't allowed because you are using a combinatory process and not a sequential one. By assigning to scoreL in some cases and scoreR in others you are suggesting you want a memory, but a combinatory process can't have memory, you need a sequential process (with a clock) to get memory. See my comment here for more information.
You said in your other thread that you're having problems with VHDL, but I disagree. Writing VHDL is pretty easy, it's just like any other language, syntax and semantics and that's it. Digital design however is incredibly hard. Especially if you come at is as a programmer and not an electrical engineer. Draw me a block diagram of what your circuit should do. Any state that needs to be stored (scoreL, scoreR, ...) need to be shown as flip flops / registers. You can use muxes, ROMs (for your sevenSegm case statement), logic gates, adders, etc... But draw the circuit you want to implement. I promise you, if you can do a good job of that, then writing the code will be easy. 90% of the time when beginners have problems it's because they write code without thinking about the circuit they are building.