text
stringlengths
59
71.4k
/****************************************************************************** * (C) Copyright 2019 AMIQ Consulting * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/...
#include <bits/stdc++.h> using namespace std; const int N = 35; const int MOD = 1e9 + 7; long long n; int K, c, res; struct mat { int d[N][N]; mat() { memset(d, 0, sizeof d); } } F[N * 2][N], P[N * 2][N], Q[N * 2][N], G; int lst[N * 2]; mat operator*(mat a, mat b) { mat c; for (int i =...
/* * Copyright 2013, Homer Hsing <> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
//Copyright 1986-2014 Xilinx, Inc. All Rights Reserved. //-------------------------------------------------------------------------------- //Tool Version: Vivado v.2014.4 (lin64) Build Tue Nov 18 16:47:07 MST 2014 //Date : Sat Jun 27 17:24:12 2015 //Host : debian-Miska running 64-bit Debian GNU/Linux 7.8...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
`include "../src/registers.v" `include "../src/reg_interface.v" `include "../src/clock.v" module test_registros; wire clk; reg reset, ir_ri0_enb, ir_ri1_enb, ir_ri2_enb; wire [7:0] ow_ri0_out_data, ow_ri1_out_data, ow_ri2_out_data; reg [7:0] ir_ri0_in_data, ir_ri0_address, ir_ri1_in_data, ir_ri1_addres...
#include <bits/stdc++.h> using namespace std; pair<long double, long double> A[200666]; int st[200666], ind[200666]; long double val[200666]; bool comp(int i1, int i2) { return A[i1] < A[i2]; } bool eql(long double v1, long double v2) { return (v1 - v2 > -((long double)0.00000000000001) && v...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
`timescale 1ns/100ps /** * `timescale time_unit base / precision base * * -Specifies the time units and precision for delays: * -time_unit is the amount of time a delay of 1 represents. * The time unit must be 1 10 or 100 * -base is the time base for each unit, ranging from seconds * to femtoseconds, and must be...
// "unpacked_packed.v" // testing element-by-element repacking of arrays // repacking is a workaround to some bug that prevents bus-declared // input ports (e.g. input X [1:0]) from propagating to prsim (cosim) properly. // Workaround is implemented in wrap_verilog_modules_to_hacprsim.awk. // See multidimensional.v. /...
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 1; vector<int> g[maxn]; int n, m, k, num[maxn], pre[maxn], maxx = 0, flag = 0; void dfs(int u, int fa, int deep) { num[u] = deep; pre[u] = fa; for (int to : g[u]) { if (flag) return; if (to == fa) continue; if (...
// Copyright 2020-2022 F4PGA Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 07.01.2017 17:22:31 // Design Name: // Module Name: freq_count_sim // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // /...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
#include <bits/stdc++.h> using namespace std; template <typename T> inline T abs(T a) { return ((a < 0) ? -a : a); } template <typename T> inline T sqr(T a) { return a * a; } const int INF = (int)1E9 + 7; const long double EPS = 1E-10; const long double PI = 3.1415926535897932384626433832795...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
#include <bits/stdc++.h> using namespace std; vector<int> adj[105]; bool visited[105]; int df[1005]; int ans = 0, k = 0; void dfs(int i, int parent) { visited[i] = true; for (int j = 0; j < adj[i].size(); j++) { if (!visited[adj[i][j]]) dfs(adj[i][j], i); } } int main() { int n, m;...
// *************************************************************************** // *************************************************************************** // Copyright 2013(c) Analog Devices, Inc. // Author: Lars-Peter Clausen <> // // All rights reserved. // // Redistribution and use in source and binary forms, ...
// // my_fpga_test_count_dn.v // `timescale 1ns/1ps module my_fpga_test_count_dn; reg clk = 0, n_rst = 0; reg up = 0, dn = 0; wire [31:0] cnt; wire [3:0] cnt_1k; reg in1 = 0, in2 = 0; wire out1, out2; my_fpga uut(clk, n_rst, up, dn, cnt, cnt_1k, in1, in2, out1, out2); tbmsgs msgs()...
/*------------------------------------------------------------------------------ * This code was generated by Spiral Multiplier Block Generator, www.spiral.net * Copyright (c) 2006, Carnegie Mellon University * All rights reserved. * The code is distributed under a BSD style license * (see http://www.opensource.or...
#include <bits/stdc++.h> using namespace std; void solve() { string s; cin >> s; vector<long long> cnt(26, 0); for (auto x : s) { cnt[x - a ]++; } deque<long long> d; for (long long i = 0; i < 26; i++) { if (cnt[i]) { d.push_back(i); } } deque<long long...
module tri_light_svetofor ( //Этот модуль описывает блок имитации трехцветного светофора. //A usual tricolor traffic light. Inverter logic, 1 is off. input wire time_signal, input wire reset, output wire red, output wire yellow, output wire green ); //Блок параметров - аналог констант в Verilog. Описыва...
#include <bits/stdc++.h> using namespace std; bool a[1100][26]; vector<bool> v(1100, false); int main() { int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; for (auto c : s) a[i][c - 97] = true; } for (int i = 0; i < n; i++) { if (v[i]) continue; ...
#include <bits/stdc++.h> using namespace std; long long int ma = -1, mi = 1000000000000000; inline long long int gcd(long long int a, long long int b) { return b ? gcd(b, a % b) : a; } inline long long int lcm(long long int a, long long int b, long long int MOD) { return a / gcd(a, b) * b % MOD; } ...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
#include <bits/stdc++.h> using namespace std; int main() { int T; T = 1; while (T--) { string t, s, s1, s2; cin >> t; s = t; int i, j, x, l, a = 0; for (i = 0; i < t.length(); i++) { if (t[i] == a ) a = i; } for (i = 0; i < t.length(); i++) { if...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed under the Creative Commons Public Domain, for // any use, without warranty, 2008 by Wilson Snyder. // SPDX-License-Identifier: CC0-1.0 module t (/*AUTOARG*/ // Inputs clk ); input clk; integer cyc = 0; reg [63:0] crc; ...
#include <bits/stdc++.h> using namespace std; int w[2][2]; int kb[2], kc[2]; int size[10][10]; string s; int main() { ios_base::sync_with_stdio(0); for (int i = 0; i <= (int)(2) - 1; i++) { cin >> s; w[i][0] = s[0] - a ; w[i][1] = s[1] - 1 ; } cin >> s; kb[0] = s[0] -...
`timescale 1ns / 1ps module img_delay_ctl # ( parameter integer C_STEP_NUMBER_WIDTH = 32, parameter integer C_FRMN_WIDTH = 2, parameter integer C_TEST = 0 ) ( input clk, input eof, input wire [31:0] delay0_cnt, input wire [C_FRMN_WIDTH-1:0] delay0_frm, output reg delay0_pu...
#include <bits/stdc++.h> const int N = 2e5 + 5; const int highestboolN = 1e9; const long long unsigned inf = 1234568901234567890; const long double pi = 3.141592653589793; const int md = 1e9 + 7; using namespace std; int here = 1; void force_break() { here++; if (here >= (N * 100)) { cout ...
#include <bits/stdc++.h> using namespace std; int A[1001][1001]; int n, m, k, i, j, l, r, a, b, x, y, p, q; int main() { cin >> n >> a >> b; x = n / 2; y = n - x; p = 1; q = 2; for (i = 1; i <= a; i++) for (j = 1; j <= b; j++) { l = A[i - 1][j] % 2; r = A[i][j - 1] ...
`default_nettype none //--------------------------------------------------------------------- //-- -- //-- Company: University of Bonn -- //-- Engineer: John Bieling -- //-- ...
#include <bits/stdc++.h> using namespace std; const int MAXn = 100 + 13; int n, k, t[MAXn]; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> t[i]; cin >> k; sort(t, t + n); int i = 0, j = 0, d = 0, num = 0, ans = 0; while (j < n) { d = t[j++] - t[i]; while (d > k) d ...
/* * SBN machine with hardwired FSM control * (c) Volker Strumpen * * modified to halt execution * if result address is C all fff's * i.e. ff for fwidth=8 * by Martin Polak */ module sbn (clk, state, PC, a, b); parameter fwidth = 8; // field width of sbn operand parameter dwidth = 32; input ...
#include <bits/stdc++.h> using namespace std; int cnt_9s(long long int num); long long int power(int num, int exp); int main() { long long int num, sale, rem; cin >> num >> sale; while (1) { rem = power(10, cnt_9s(num) + 1); if (sale >= num % rem + 1) sale -= (num % rem + 1), num...
#include <bits/stdc++.h> using namespace std; int n, m, x; int main() { scanf( %d%d , &n, &m); x = n; for (int i = 0; i < m; i++) { int l, r; scanf( %d%d , &l, &r); x = min(x, r - l + 1); } printf( %d n , x); for (int i = 0; i < n; i++) printf( %d , i % x); printf( ...
#include <bits/stdc++.h> using namespace std; int n, T; double dp[5001][5001]; int p[5001], t[5001]; double quickpow(double x, int y) { double res = 1; while (y) { if (y & 1) res *= x; x *= x; y >>= 1; } return res; } int main() { cin >> n >> T; dp[0][0] = 1; ...
/* in the name of Anton */ /* Compete against Yourself. Author - Aryan (@aryanc403) Atcoder library - https://atcoder.github.io/ac-library/production/document_en/ */ #include <algorithm> #include <cassert> #include <limits> #include <queue> #include <vector> #include <algorithm> ...
#include <bits/stdc++.h> using namespace std; int main() { int k, l, m, n, d, x = 0; cin >> k; cin >> l; cin >> m; cin >> n; cin >> d; int arr[] = {k, l, m, n}; for (int i = 1; i <= d; i++) { for (int j = 0; j < 4; j++) { if (i % arr[j] == 0) { x++; ...
//Legal Notice: (C)2016 Altera Corporation. All rights reserved. Your //use of Altera Corporation's design tools, logic functions and other //software and tools, and its AMPP partner logic functions, and any //output files any of the foregoing (including device programming or //simulation files), and any associated do...
`timescale 1ns / 1ps `include "../src/axis_blender.v" module test_axis_blender_2lvl( ); parameter integer C_CHN_WIDTH = 8; parameter integer C_S0_CHN_NUM = 1; parameter integer C_S1_CHN_NUM = 3; parameter integer C_ALPHA_WIDTH = 8; parameter integer C_S1_ENABLE =...
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1); struct myHash { template <class T1, class T2> size_t operator()(const pair<T1, T2>& p) const { auto hash1 = hash<T1>{}(p.first); auto hash2 = hash<T2>{}(p.second); return hash1 ^ hash2; } }; class segTree {...
#include <bits/stdc++.h> using namespace std; const int maxn = 1000 * 100 + 15; int n, mark[maxn], h[maxn], d[maxn], g[2], cnt, c, w; vector<int> ad[maxn]; void dfs(int v) { mark[v] = 1; for (auto u : ad[v]) { if (mark[u] == 0) { h[u] = h[v] + 1; dfs(u); } } } int m...
// ========== Copyright Header Begin ========================================== // // OpenSPARC T1 Processor File: sparc_exu_rndrob.v // Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. // // The above named program is free software; you can redistribute it ...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
#include <bits/stdc++.h> using namespace std; int n, p; bool prime(int num) { for (int i = 2; i <= sqrt(num); i++) { if (num % i == 0) return 0; } return 1; } int main() { cin >> n; if (prime(n)) { return cout << 1 << endl << n, 0; } p = (n - 3) / 2; cout << 3 << ...
/* Copyright (c) 2014-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
#include <bits/stdc++.h> using namespace std; int longestIncreasingSubsequenceDP(int a[], int n) { int dp[n], ans = 0; for (int k = 0; k < n; k++) { dp[k] = 1; for (int i = 0; i < k; i++) { if (a[i] <= a[k]) { dp[k] = max(dp[k], dp[i] + 1); ans = max(dp[k], ans); ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ; long long int n; cin >> n; string s; cin >> s; vector<long long int> v(n + 1, 0); for (long long int i = 1; i <= n; i++) { if (s[i - 1] == ( ) ...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 23:04:15 03/13/2015 // Design Name: // Module Name: PreProcessX // Project Name: // Target Devices: // Tool versions: // Description: // // Dep...
#include <bits/stdc++.h> using namespace std; const int N = 105; const int M = 2005; pair<pair<int, int>, pair<int, int> > adj[N]; int dp[M]; vector<int> way[M]; bool cmp(pair<pair<int, int>, pair<int, int> > a, pair<pair<int, int>, pair<int, int> > b) { return a.second.second < b.second.se...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
#include <bits/stdc++.h> using namespace std; int in[201000]; int main() { int n; scanf( %d , &n); for (int i = 0; i < (n); i++) { scanf( %d , &in[i]); in[i] += i; } sort(in, in + n); for (int i = 0; i < (n - 1); i++) { if (in[i] == in[i + 1]) { puts( :( ); ...
// File name : DebouncerWithoutLatch.v // Written by : Jianjian Song // debouncing an input switch //if (Switch==1) delay a bit and test again. if (switch==1) output is 1 //else output is 0 //visa verse `timescale 1ns / 1ps module DebouncerWithoutLatch(InputPulse, DebouncedOuput, Reset, CLOCK) ; input InputPulse, Re...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
#include <bits/stdc++.h> using namespace std; int n, m, num[100100]; inline int as(int u) { int a, b; if (num[u]) return num[u]; printf( ? %d n , u); fflush(stdout); scanf( %d , &a); return num[u] = a; } inline void pd(int u) { if (as(u) == as(u + m)) { printf( ! %d n , u); ...
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d, x, y, g, h, i, j, k, n, t, z = 0, l, r, u; cin >> t; while (t--) { cin >> n; for (i = 0; i < n; i++) cout << 1 << ; cout << endl; } }
(****************************************************************************) (* Copyright 2020 The Project Oak Authors *) (* *) (* Licensed under the Apache License, Version 2.0 (the "License") *) (* y...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
#include <bits/stdc++.h> using namespace std; const int debug_ = 0; const int maxn = 200000; const long long inf = 998244353; int unum[33], dnum[33]; long long dp[33][2][2][2]; long long dfs(int pos, int u, int e, int d) { if (pos == -1) { return 2 - e; } if (dp[pos][u][e][d] != -1) { ...
#include <bits/stdc++.h> using namespace std; int a[100100]; int d[100100]; int main() { int n; scanf( %d , &n); for (int i = 0; i < n; i++) { scanf( %d , &a[i]); } for (int i = 0; i <= n; i++) { d[i] = 100100; } d[0] = 0; for (int i = 0; i < n; i++) { int l = 0...
#include <bits/stdc++.h> using namespace std; const int N = 2e3 + 2; bitset<N> equa[N], value[N]; int ans[N], hehe[N]; signed main() { ios::sync_with_stdio(0); cin.tie(0); int n, m, i, j, k, l, num = 0; cin >> n >> m; for (i = 0; i < n; i++) { value[2 * i][2 * i] = 1; value[2 *...
//////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2014, University of British Columbia (UBC); All rights reserved. // // // // Redistribution and use in source and binary forms, w...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); int a, b; cin >> a >> b; for (int i = 1; i <= a; ++i) cout << i << ; cout << a + b + 1; for (int i = a + b; i > a; --i) cout << << i; return 0; }
// DESCRIPTION: Verilator: Test for using DPI as general accessors // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2012. // SPDX-License-Identifier: CC0-1.0 // // Contributed by Jeremy Bennett and Jie Xul // // This test exercises the use of DPI to access signals and registers i...
module fmrv32im_mul ( input RST_N, input CLK, input INST_MUL, input INST_MULH, input INST_MULHSU, input INST_MULHU, input [31:0] RS1, input [31:0] RS2, output WAIT, output READY, output [31:0] RD ); wire inst_mul,...
#include <bits/stdc++.h> int scan() { int noRead = 0; char p = getchar(); for (; p < 33;) { p = getchar(); } while (p > 32) { noRead = (noRead << 3) + (noRead << 1) + (p - 0 ); p = getchar(); } return noRead; } long long int lscan() { long long int noRead = 0; ...
module KeyExpansion ( key, expandedKey ); localparam NR = 10; input [127:0] key; output [128*(NR+1)-1:0] expandedKey; wire [31:0] w[4*(NR+1)-1:0]; wire [31:0] t[NR-1:0]; wire [7:0] RCon[NR-1:0]; wire [31:0] rotWord[NR-1:0...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
`timescale 1ns / 1ps ///////////////////////////////////////////////////////////////////////////////////// // Company: Digilent Inc. // Engineer: Andrew Skreen // Josh Sackos // // Create Date: 07/26/2012 // Module Name: slaveSelect // Project Name: PmodACL_Demo // Target Devices: Nexys3 // Tool versions: ...
#include <bits/stdc++.h> using namespace std; struct comp { bool operator()(const vector<long long>& lhs, const vector<long long>& rhs) const { return lhs[0] > rhs[0] || (lhs[0] == rhs[0] && lhs[2] > rhs[2]) || (lhs[0] == rhs[0] && lhs[2] == rhs[2] && lhs[1] > rhs[1]); ...
/*+-------------------------------------------------------------------------- Copyright (c) 2015, Microsoft Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code ...
#include <bits/stdc++.h> using namespace std; int main() { int ans = 0; string s; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == 1 ) ans += 10; else if (s[i] == A ) ans += 1; else ans += s[i] - 0 ; } cout << ans; return 0; }
#include <bits/stdc++.h> int main() { int x, y, x1 = 0, y1 = 0, n, k = 0; do { scanf( %d%d , &x, &n); } while (x < 1 || n < 1 || n > 100000 || x > 100000); y = x; if ((x == 4 && n == 2) || (x > 5 && n < 4) || x <= n || n < 4) { printf( %d n , (x == n && x != 1) ...
//================================================================================================== // Filename : arbite.v // Created On : 2015-04-09 10:25:59 // Last Modified : 2015-05-24 20:54:42 // Revision : 1.0 // Author : Angel Terrones // Company : Universidad Simón Bolívar // E...
// -- (c) Copyright 2010 - 2013 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a...
// (c) Copyright 1995-2014 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant ...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
/*************************************************************************** * pcx2mb_entry.v: A single buffer entry for the SPARC PCX to MicroBlaze * FSL Fifo. This register entry will be instantiated 9 times. * * NOTE: Pipeline stages from SPARC point of view are * PQ Initial Request * PA Data sent for ...
// $Id: c_reversor.v 1534 2009-09-16 16:10:23Z dub $ /* Copyright (c) 2007-2009, Trustees of The Leland Stanford Junior University All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of sou...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 22:36:46 09/06/2015 // Design Name: // Module Name: FPU_Multiplication_Function // Project Name: // Target Devices: // Tool versions: // Description: // // ...
`timescale 1ns / 1ps module water_let_mode_tb(); reg [31:0]clk; reg water_in_start, water_out_start, power, start; reg [2:0]weight; wire [2:0]water_level; wire water_in_end_sign, water_out_end_sign; parameter DELAY = 10; parameter TIME = 1000; water_let_mode DUT ( .water_...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n, m; cin >> n >> m; map<int, int> a; long long x; for (long long i = 0; i < m; i++) { cin >> x; a[x]++; } long long mini = INT_MAX; for (long lon...
// file: Clock70MHz.v // // (c) Copyright 2008 - 2011 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a...
#include <bits/stdc++.h> using namespace std; const int MAXN = 2001; char a[MAXN][MAXN]; int n, v[MAXN], r[MAXN], c[MAXN]; int gao() { int ret = 0; memset(r, 0, sizeof(int) * n); memset(c, 0, sizeof(int) * n); for (int i = 0; i < n - 1; ++i) { for (int j = n - 1; j > i; --j) { if...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
// Check that dynamic arrays of packed array types are supported module main; typedef reg [3:0] T1; typedef T1 [7:0] T2; T2 foo[]; int idx; initial begin if (foo.size() != 0) begin $display("FAILED -- foo.size()=%0d, s.b. 0", foo.size()); $finish; end foo = new[10]; if (foo...
//================================================================================================== // Filename : antares_mux_4_1.v // Created On : Mon Aug 31 23:14:22 2015 // Last Modified : Sat Nov 07 12:14:18 2015 // Revision : 0.1 // Author : Angel Terrones // Company : Universidad ...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
#include <bits/stdc++.h> using namespace std; inline int gcd(int a, int b) { while (b > 0) { int t = a; a = b; b = t % b; } return a; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i)...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
// file: sdram_clk_gen_tb.v // // (c) Copyright 2008 - 2011 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is...
/* I seem to have found a problem with the $monitor task/events. (this is probably related to bug 399) The problem only seems to arise in vvp mode and not in vvm. Problem: $monitor seems to lose both the first and last time steps. A complete copy of the run follows with source appended at the end. (The cor...
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const long long LINF = 0x3f3f3f3f3f3f3f3fll; vector<int> a; vector<int> b; vector<int> c; vector<vector<int> > g; int n, m, k; int dp[5005][5005]; int solve(int at, int homens) { if (at == n) { return 0; } if...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int n; cin >> n; map<long long int, long long int> mp; vector<long long int> v(n); vector<long long int> cSum(n, 0); for (long long int i = 0; i < n; i++) { cin...
// Copyright 2020-2022 F4PGA Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...