본문 바로가기

반응형

과제모음

(122)
64비트형 정수선언하기(Visual Studio) 이번 심플즈 알고리즘 2번을 풀면서 가장 고민했던 부분은 알고리즘이 아닌 애초에 주어진 값이 너무 크다는 것이었습니다. 보통 32비트 운영체제를 쓰시는 분들은 이문제를 해결하기위해 char 나 string 값으로 입력받고 다시 그것을 정수형으로 바꾸는 방법을 사용하시면 되지 않을까란 생각을 해봅니다. 하지만 현재 사용하고 있는 운영체제와 CPU가 64비트를 지원 한다면 한번쯤 이러한 방법을 쓰는것도 괜찮을듯 싶네요 비주얼스튜디오2008에서 64비트형으로 int 형 변수를 선언한 모습입니다. 눈치가 빠르신 분들은 문제풀이 보면서 벌써 알아채셨을수도 있겠네요.
MUX(멀티플렉서) - VHDL AMUX--------------------------------------------------------------------------------- Library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; Entity AMUX is port(IR_out : in std_logic_vector(7 downto 0); PC_out : in std_logic_vector(7 downto 0); Asel : in std_logic; addr : out std_logic_vector(7 downto 0)); end AMUX; architecture BEHAV of AMUX is..
ALU-산술연산장치 Library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; Entity ALU is port(rst : in std_logic; ALUfs : in std_logic_vector(2 downto 0); a : in std_logic_vector(7 downto 0); b : in std_logic_vector(7 downto 0); sum : out std_logic_vector(7 downto 0)); end ALU; Architecture BEHAV of ALU is begin process(rst, ALUfs, a,b) begin if(rst = '1') then sum..
ACC - accumulator(누산기) Library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; Entity ACC is port(clk : in std_logic; rst_n : in std_logic; ACCce : in std_logic; sum : in std_logic_vector(7 downto 0); ACC15 : out std_logic; ACCz : out std_logic; a : out std_logic_vector(7 downto 0)); End ACC; Architecture BEHAV of ACC is signal acc_r : std_logic_vector(7 downto 0); beg..
PC-(Program Counter) Library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity PC is port(PCce : in std_logic; clk : in std_logic; rst_n : in std_logic; sum : in std_logic_vector(7 downto 0); pc_out : out std_logic_vector(7 downto 0)); end PC; architecture BEHAV of PC is begin process(clk, rst_n, Pcce) begin if(rst_n = '0')then pc_out '0'); elsif(clk ='0' and cl..
IR(Instruction Register)-VHDL( 명령어레지스터) Library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity IR is port( rst_n : in std_logic; clk : in std_logic; irce : in std_logic; data : in std_logic_vector(7 downto 0); ir_out : out std_logic_vector(7 downto 0); opcode : out std_logic_vector(3 downto 0)); end IR; architecture BEHAV of IR is signal ir_r : std_logic_vector(7 downto 0); beg..
MU0 Control Unit(한국항공대 09년도 디지털논리실험 프로젝트) 위의 표의 상태에 맞추어 VHDL 코딩을 하도록 합니다. Library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity controlunit is port(Opcode : in std_logic_vector (3 downto 0); Reset : in std_logic; ExftI : in std_logic; ACCz : in std_logic; ACC15 : in std_logic; Asel : out std_logic; Bsel : out std_logic; ACCce : out std_logic; PCce : out std_logic; IRce : out std..
JAVA-소켓프로그래밍(에코클라이언트) ver1 import java.net.*; import java.io.*; import javax.swing.plaf.SliderUI; public class Client{ public static void main(String[] args){ try{ ServerSocket listen = new ServerSocket(10002); Socket sock = new Socket("127.0.0.1", 10001); BufferedReader keybord = new BufferedReader(new InputStreamReader(System.in)); OutputStream out = sock.getOutputStream(); InputStream in = sock.getInputStream(); PrintW..

반응형