Clasified in Notes of Computers of University.
Written at May 09, 2010 on
English with a size of 1,316 bytes.
Program Test_case
Implicit none
integer::temp
print*,"digite a temperatura d hj:"
read(*,*)temp
select case(temp)
case( :-1)
print*, "esta congelando"
case(0)
print*, "esta zero graus"
case (1:20)
print*,"esta frio"
case(21:25)
print*,"esta normal"
case default
print*,"esta quente"
end select
end program
program fatorial
implicit none
integer::i,fat,n
write(*,*) "valor d n="
read(*,*)n
i=1
fat=1
do while(i<=n)
fat=fat*i
i=i+1
end do
print*, "o fatorial de", n,"eh", fat,
end program
Program test_do
implicit none
integer::i
do i=50,2,-2
if(mod(i,10)==0) cycle
print*,i
end do
end program
escrever um programa capaz de calcular e mostrar a media d 10 valores digitados
... (Continue)Clasified in Notes of Computers of University.
Written at May 09, 2010 on
English with a size of 2,541 bytes.
programa capaz d mostrar o semestre d entrada, o ano, o codigo do cusro, o sequencial da matrícula, a partir da informação da matrícula de um aluno, quantas vezes o operador desejar
program matricula
implicit none
integer::mat, sem, ano, curso, seq
character::resp
do
print*,"digite matrícula"
read(*,*) mat
sem=mat/10**7
mat= mod(mat,10**7)
ano=mat/10**5 +2000
mat=mod(mat,10**5)
curso=mat/10**3
seq=mod(mat,10**3)
print*, "semestre:",sem
print*,"ano:",ano
print*,"curso",curso
print*,"sequencial",seq
print*,"nova matrcula? S/N"
read(*,*) resp
if(resp/="S" .and. resp/="s")exit
end do
end program
digite n° binario d até 8bits e calcule seu equivalente decimal
program Bindec
implicit none
interger::nbim,ndec,i
character::resp
do
print*,"digite numero binario:"
... (Continue)Clasified in Notes of Computers of University.
Written at May 20, 2010 on
English with a size of 676 bytes.
Static Linking
Static linkers such as the Unix ld program take as input a collection of relocatable object files and command
line arguments and generate as output a fully linked executable object file that can be loaded and run. The
input relocatable object files consist of various code and data sections. Instructions are in one section,
initialized global variables are in another section, and uninitialized variables are in yet another section.
To build the executable, the linker must perform two main tasks:
Clasified in Notes of Computers of University.
Written at June 28, 2010 on
English with a size of 8,575 bytes.
calcular hipotnusa [subrotina]
progam pitagoras
implicit none
real::a,b,c
print,"digite b
read(*,*)b
print*,"digite c"
read(*,*)c
call hipo(b,c,a)
print*,"hipotenusa:",a
end program
sbtoutine hipo (l1,l2,h)
implicit none
real,intent(in)::l1,l2
real,intent(out)::h
h=sqrt(l1**2+l2**2)
return
end subtoutine
exemplo [surotina]
program exemplo
implicit none
integer, parameter::max=5
character(len=20),dimensionnt(max)::nome
print*,"digite nomes"
read(*,*)nome
call ordena(max,nome)
print*,"nomes ordenados:"
print*,nome
end program
sbroutine ordena(n,vet)
implicit none
integer,intent(in):n
character(len=20),intent(inout),diemsnion(n)::vet
integer::i,j
character(len=20)::aux
do i=1,n-1
do j=i+1,n
... (Continue)Clasified in Homeworks of Computers of University.
Written at June 25, 2010 on
English with a size of 18,380 bytes.
... (Continue)#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#define maxsize 10
int Arr[50];
int copia[50];
int cop=0;
FILE *fp;
FILE *fi;
class manipulacion
{
public:
Clasified in Homeworks of Computers of University.
Written at June 25, 2010 on
English with a size of 13,823 bytes.
... (Continue)#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#define maxsize 10
int Arr[50];
int copia[50];
int cop=0;
FILE *fp;
FILE *fi;
Clasified in Notes of Computers of University.
Written at June 28, 2010 on
English with a size of 4,496 bytes.
armazenar 12 valores em uma matriz 4x3,mostrar a transposta
program transposta
implicit none
real,dimension(4,3)::m
real,dimension(3,4)::t
integer::i,j
do i=1,4
doj=1,3
print*,"digite valor"
read(*,*)m(i,j)
t(j,i)=m(i,j)
end do
end do
do i=1,3
print*,t(i,j), j=1,4
end do
end program
produto d duas matrizes, 4x3 e 3x4
program produto
implicit none
real,dimension(4,3)::a
integer,dimension(3,4)::b
real,dimension(4,4)::p
integer::i,j,k
print*, "dgite matriz a"
read(*,*)a
print*,"digite matriz b"
read(*,*)b
do i=1,4
doj=1,4
p(i,j)=0
do k=1,3
p(i,j)=p(i,j)+a(i,k)*b(k,j)
end do
end do
end do
do i=1,4
print*, (p(i,j),j=1,4)
end do
end program
MATRICULA
program matricula
... (Continue)Clasified in Notes of Computers of University.
Written at June 28, 2010 on
English with a size of 2,010 bytes.
12 valores em uma matriz 3x4, calcular a transposta, o produto entre as duas
matriz soluçao msm dimensao q produto, diagonal principal=1, outros elementos c foram par=1 e impar=0
program matriz
implicit none
integer,dimension(3,4)::m
integer,dimension(4,3)::t
integer,dimension(4,4)::p
integer::i,j,k
print*,"digite valores da matriz m:"
read(*,*)m(i,j)
do i=1,4
do j=1,3
t(i,j)=m(j,i)
end do
end do
do i=1,4
do j=1,4
p(i,j)=0
do k=1,3
P(i,j)=p(i,J)+t(i,k)*m(k,j)
end do
end do
do i=1,4
do j=1,4
if(mod(p(i,j),2)==0).or.(i==j)) then
P(i,j)=1
else
p(i,j)=0
endif
end do
end do
do i=1,4
print*,(p(i,j),j=1,4)
end do
end program
calcular hipotnusa [subrotina]
progam pitagoras
implicit none
... (Continue)Clasified in Notes of Computers of University.
Written at July 05, 2010 on
English with a size of 1,841 bytes.
****CREAR_TABLESPACE**** CREATE SMALLFILE TABLESPACE "tbl_user" DATAFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\tbl_user' SIZE 100M AUTOEXTEND ON NEXT 10M MAXSIZE 200M LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
****CREAR_TABLESPACE_TEMPORAL**** CREATE SMALLFILE TEMPORARY TABLESPACE "TEMPORAL" TEMPFILE 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMPORAL_RSD.dbf' SIZE 200M AUTOEXTEND ON NEXT 20M MAXSIZE 300M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M
***rol_escritura****
create role " rol_escritura" not identified
GRANT CREATE ANY PROCEDURE TO "ROL_ESCRITURA"
GRANT CREATE ANY TABLE TO "ROL_ESCRITURA"
GRANT CREATE ANY VIEW TO "ROL_ESCRITURA"
GRANT "CONNECT" TO "ROL_ESCRITURA"
GRANT "ROL_ESCRITURA" TO "ROL_ESCRITURA"
**+usuariow****
CREATE USER "USER_W" PROFILE "DEFAULT" IDENTIFIED BY "*******" DEFAULT TABLESPACE "TBL_USER" temporary tablespace "temporal" ACCOUNT UNLOCK
... (Continue)Clasified in Notes of Computers of University.
Written at September 15, 2009 on
English with a size of 2,804 bytes.
library ieee; - - type memoria is array (2**M-1 downto 0) of std_logic_vector (N-1 downto 0);
use ieee.std_logic_1164.all; -- signal mem : memoria;
use ieee.numeric_std.all;
use std.textio.all;
use ieee.std_logic_textio.all;
entity alu_tb is
end alu_tb;
architecture sim of alu_tb is -- constant tclk : time := 10ns;
component alu -- clk_i<=not clk:i after tclk/2;
generic ( -- hacer clk asimetrico clk_i<='1' after 25 ns when clk_i = '0' else '0' after 75 ns;
N : positive);
port (
a, b : in std_logic_vector (4*N-1 downto 0);
opr : in std_logic;
ovfw_sign : out std_logic;
resultado : out std_logic_vector (4*N-1 downto 0));
end component;
constant N : positive := 4;
signal a_i, b_i : std_logic_vector (4*N-1 downto 0);
signal opr_i : std_logic;
signal ovfw_sign_i : std_logic;
signal resultado_i : std_logic_vector (4*N-1 downto 0);